Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
Represents a byte range as used in the Range header.
If end
is non-negative, then start
and end
represent the bounds
of of the range, counting from 0. (Eg, the first 500 bytes would be
represented as start
= 0 and end
= 499.)
If end
is -1 and start
is non-negative, then this represents a
range starting at start
and ending with the last byte of the
requested resource body. (Eg, all but the first 500 bytes would be
start
= 500, and end
= -1.)
If end
is -1 and start
is negative, then it represents a "suffix
range", referring to the last -start
bytes of the resource body.
(Eg, the last 500 bytes would be start
= -500 and end
= -1.)
Since: 2.26
Synopsis
- newtype Range = Range (ManagedPtr Range)
- newZeroRange :: MonadIO m => m Range
- noRange :: Maybe Range
- getRangeEnd :: MonadIO m => Range -> m Int64
- setRangeEnd :: MonadIO m => Range -> Int64 -> m ()
- getRangeStart :: MonadIO m => Range -> m Int64
- setRangeStart :: MonadIO m => Range -> Int64 -> m ()
Exported types
Memory-managed wrapper type.
Instances
WrappedPtr Range Source # | |
Defined in GI.Soup.Structs.Range wrappedPtrCalloc :: IO (Ptr Range) # wrappedPtrCopy :: Range -> IO Range # | |
tag ~ AttrSet => Constructible Range tag Source # | |
Defined in GI.Soup.Structs.Range |
Properties
end
the end of the range
getRangeEnd :: MonadIO m => Range -> m Int64 Source #
Get the value of the “end
” field.
When overloading is enabled, this is equivalent to
get
range #end
setRangeEnd :: MonadIO m => Range -> Int64 -> m () Source #
Set the value of the “end
” field.
When overloading is enabled, this is equivalent to
set
range [ #end:=
value ]
start
the start of the range
getRangeStart :: MonadIO m => Range -> m Int64 Source #
Get the value of the “start
” field.
When overloading is enabled, this is equivalent to
get
range #start
setRangeStart :: MonadIO m => Range -> Int64 -> m () Source #
Set the value of the “start
” field.
When overloading is enabled, this is equivalent to
set
range [ #start:=
value ]