gi-glib-2.0.2: GLib bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.GLib.Structs.Bytes

Contents

Description

A simple refcounted data type representing an immutable sequence of zero or more bytes from an unspecified origin.

The purpose of a #GBytes is to keep the memory region that it holds alive for as long as anyone holds a reference to the bytes. When the last reference count is dropped, the memory is released. Multiple unrelated callers can use byte data in the #GBytes without coordinating their activities, resting assured that the byte data will not change or move while they hold a reference.

A #GBytes can come from many different origins that may have different procedures for freeing the memory region. Examples are memory from g_malloc(), from memory slices, from a #GMappedFile or memory from other allocators.

GHashTable. Use g_bytes_equal() and g_bytes_hash() as parameters to g_hash_table_new() or g_hash_table_new_full(). GTree by passing the g_bytes_compare() function to g_tree_new().

The data pointed to by this bytes must not be modified. For a mutable array of bytes see #GByteArray. Use g_bytes_unref_to_array() to create a mutable array for a GBytes from a mutable #GByteArray, use the g_byte_array_free_to_bytes() function.

Synopsis

Exported types

newtype Bytes Source #

Constructors

Bytes (ForeignPtr Bytes) 

Instances

BoxedObject Bytes Source # 

Methods

boxedType :: Bytes -> IO GType

((~) * info (ResolveBytesMethod t Bytes), MethodInfo * info Bytes p) => IsLabel t (Bytes -> p) Source # 

Methods

fromLabel :: Proxy# Symbol t -> Bytes -> p

((~) * info (ResolveBytesMethod t Bytes), MethodInfo * info Bytes p) => IsLabelProxy t (Bytes -> p) Source # 

Methods

fromLabelProxy :: Proxy Symbol t -> Bytes -> p

((~) * signature (Word64 -> m (Ptr ())), MonadIO m) => MethodInfo * BytesUnrefToDataMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesUnrefToDataMethodInfo Bytes -> signature -> s

((~) * signature (m ByteString), MonadIO m) => MethodInfo * BytesUnrefToArrayMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesUnrefToArrayMethodInfo Bytes -> signature -> s

((~) * signature (m ()), MonadIO m) => MethodInfo * BytesUnrefMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesUnrefMethodInfo Bytes -> signature -> s

((~) * signature (m Bytes), MonadIO m) => MethodInfo * BytesRefMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesRefMethodInfo Bytes -> signature -> s

((~) * signature (Word64 -> Word64 -> m Bytes), MonadIO m) => MethodInfo * BytesNewFromBytesMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesNewFromBytesMethodInfo Bytes -> signature -> s

((~) * signature (m Word32), MonadIO m) => MethodInfo * BytesHashMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesHashMethodInfo Bytes -> signature -> s

((~) * signature (m Word64), MonadIO m) => MethodInfo * BytesGetSizeMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesGetSizeMethodInfo Bytes -> signature -> s

((~) * signature (m ByteString), MonadIO m) => MethodInfo * BytesGetDataMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesGetDataMethodInfo Bytes -> signature -> s

((~) * signature (Bytes -> m Bool), MonadIO m) => MethodInfo * BytesEqualMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesEqualMethodInfo Bytes -> signature -> s

((~) * signature (Bytes -> m Int32), MonadIO m) => MethodInfo * BytesCompareMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesCompareMethodInfo Bytes -> signature -> s

type AttributeList Bytes Source # 
type AttributeList Bytes

Methods

bytesCompare

data BytesCompareMethodInfo Source #

Instances

((~) * signature (Bytes -> m Int32), MonadIO m) => MethodInfo * BytesCompareMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesCompareMethodInfo Bytes -> signature -> s

bytesCompare :: MonadIO m => Bytes -> Bytes -> m Int32 Source #

bytesEqual

data BytesEqualMethodInfo Source #

Instances

((~) * signature (Bytes -> m Bool), MonadIO m) => MethodInfo * BytesEqualMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesEqualMethodInfo Bytes -> signature -> s

bytesEqual :: MonadIO m => Bytes -> Bytes -> m Bool Source #

bytesGetData

data BytesGetDataMethodInfo Source #

Instances

((~) * signature (m ByteString), MonadIO m) => MethodInfo * BytesGetDataMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesGetDataMethodInfo Bytes -> signature -> s

bytesGetData :: MonadIO m => Bytes -> m ByteString Source #

bytesGetSize

data BytesGetSizeMethodInfo Source #

Instances

((~) * signature (m Word64), MonadIO m) => MethodInfo * BytesGetSizeMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesGetSizeMethodInfo Bytes -> signature -> s

bytesGetSize :: MonadIO m => Bytes -> m Word64 Source #

bytesHash

data BytesHashMethodInfo Source #

Instances

((~) * signature (m Word32), MonadIO m) => MethodInfo * BytesHashMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesHashMethodInfo Bytes -> signature -> s

bytesHash :: MonadIO m => Bytes -> m Word32 Source #

bytesNew

bytesNew :: MonadIO m => Maybe ByteString -> m Bytes Source #

bytesNewFromBytes

data BytesNewFromBytesMethodInfo Source #

Instances

((~) * signature (Word64 -> Word64 -> m Bytes), MonadIO m) => MethodInfo * BytesNewFromBytesMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesNewFromBytesMethodInfo Bytes -> signature -> s

bytesNewFromBytes :: MonadIO m => Bytes -> Word64 -> Word64 -> m Bytes Source #

bytesNewTake

bytesNewTake :: MonadIO m => Maybe ByteString -> m Bytes Source #

bytesRef

data BytesRefMethodInfo Source #

Instances

((~) * signature (m Bytes), MonadIO m) => MethodInfo * BytesRefMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesRefMethodInfo Bytes -> signature -> s

bytesRef :: MonadIO m => Bytes -> m Bytes Source #

bytesUnref

data BytesUnrefMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m) => MethodInfo * BytesUnrefMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesUnrefMethodInfo Bytes -> signature -> s

bytesUnref :: MonadIO m => Bytes -> m () Source #

bytesUnrefToArray

data BytesUnrefToArrayMethodInfo Source #

Instances

((~) * signature (m ByteString), MonadIO m) => MethodInfo * BytesUnrefToArrayMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesUnrefToArrayMethodInfo Bytes -> signature -> s

bytesUnrefToArray :: MonadIO m => Bytes -> m ByteString Source #

bytesUnrefToData

data BytesUnrefToDataMethodInfo Source #

Instances

((~) * signature (Word64 -> m (Ptr ())), MonadIO m) => MethodInfo * BytesUnrefToDataMethodInfo Bytes signature Source # 

Methods

overloadedMethod :: MethodProxy BytesUnrefToDataMethodInfo Bytes -> signature -> s

bytesUnrefToData :: MonadIO m => Bytes -> Word64 -> m (Ptr ()) Source #