Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
A structure which globally uniquely identifies a ref as the tuple
(collectionId
, refName
). For backwards compatibility, collectionId
may be Nothing
,
indicating a ref name which is not globally unique.
Since: 2018.6
Synopsis
- newtype CollectionRef = CollectionRef (ManagedPtr CollectionRef)
- newZeroCollectionRef :: MonadIO m => m CollectionRef
- collectionRefDup :: (HasCallStack, MonadIO m) => CollectionRef -> m CollectionRef
- collectionRefDupv :: (HasCallStack, MonadIO m) => [CollectionRef] -> m [CollectionRef]
- collectionRefEqual :: (HasCallStack, MonadIO m) => Ptr () -> Ptr () -> m Bool
- collectionRefFree :: (HasCallStack, MonadIO m) => CollectionRef -> m ()
- collectionRefFreev :: (HasCallStack, MonadIO m) => [CollectionRef] -> m ()
- collectionRefHash :: (HasCallStack, MonadIO m) => Ptr () -> m Word32
- collectionRefNew :: (HasCallStack, MonadIO m) => Maybe Text -> Text -> m (Maybe CollectionRef)
- clearCollectionRefCollectionId :: MonadIO m => CollectionRef -> m ()
- getCollectionRefCollectionId :: MonadIO m => CollectionRef -> m (Maybe Text)
- setCollectionRefCollectionId :: MonadIO m => CollectionRef -> CString -> m ()
- clearCollectionRefRefName :: MonadIO m => CollectionRef -> m ()
- getCollectionRefRefName :: MonadIO m => CollectionRef -> m (Maybe Text)
- setCollectionRefRefName :: MonadIO m => CollectionRef -> CString -> m ()
Exported types
newtype CollectionRef Source #
Memory-managed wrapper type.
CollectionRef (ManagedPtr CollectionRef) |
Instances
newZeroCollectionRef :: MonadIO m => m CollectionRef Source #
Construct a CollectionRef
struct initialized to zero.
Methods
Overloaded methods
dup
:: (HasCallStack, MonadIO m) | |
=> CollectionRef |
|
-> m CollectionRef | Returns: a newly allocated copy of |
Create a copy of the given ref
.
Since: 2018.6
dupv
:: (HasCallStack, MonadIO m) | |
=> [CollectionRef] |
|
-> m [CollectionRef] | Returns: a newly allocated copy of |
Copy an array of OstreeCollectionRefs
, including deep copies of all its
elements. refs
must be Nothing
-terminated; it may be empty, but must not be
Nothing
.
Since: 2018.6
equal
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> Ptr () |
|
-> m Bool | Returns: |
Compare ref1
and ref2
and return True
if they have the same collection ID and
ref name, and False
otherwise. Both ref1
and ref2
must be non-Nothing
.
Since: 2018.6
free
:: (HasCallStack, MonadIO m) | |
=> CollectionRef |
|
-> m () |
Free the given ref
.
Since: 2018.6
freev
:: (HasCallStack, MonadIO m) | |
=> [CollectionRef] |
|
-> m () |
Free the given array of refs
, including freeing all its elements. refs
must be Nothing
-terminated; it may be empty, but must not be Nothing
.
Since: 2018.6
hash
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m Word32 | Returns: hash value for |
Hash the given ref
. This function is suitable for use with HashTable
.
ref
must be non-Nothing
.
Since: 2018.6
new
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> Text |
|
-> m (Maybe CollectionRef) | Returns: a new |
Create a new CollectionRef
containing (collectionId
, refName
). If
collectionId
is Nothing
, this is equivalent to a plain ref name string (not a
refspec; no remote name is included), which can be used for non-P2P
operations.
Since: 2018.6
Properties
collectionId
collection ID which provided the ref, or Nothing
if there
is no associated collection
clearCollectionRefCollectionId :: MonadIO m => CollectionRef -> m () Source #
Set the value of the “collection_id
” field to Nothing
.
When overloading is enabled, this is equivalent to
clear
#collectionId
getCollectionRefCollectionId :: MonadIO m => CollectionRef -> m (Maybe Text) Source #
Get the value of the “collection_id
” field.
When overloading is enabled, this is equivalent to
get
collectionRef #collectionId
setCollectionRefCollectionId :: MonadIO m => CollectionRef -> CString -> m () Source #
Set the value of the “collection_id
” field.
When overloading is enabled, this is equivalent to
set
collectionRef [ #collectionId:=
value ]
refName
ref name
clearCollectionRefRefName :: MonadIO m => CollectionRef -> m () Source #
Set the value of the “ref_name
” field to Nothing
.
When overloading is enabled, this is equivalent to
clear
#refName
getCollectionRefRefName :: MonadIO m => CollectionRef -> m (Maybe Text) Source #
Get the value of the “ref_name
” field.
When overloading is enabled, this is equivalent to
get
collectionRef #refName
setCollectionRefRefName :: MonadIO m => CollectionRef -> CString -> m () Source #
Set the value of the “ref_name
” field.
When overloading is enabled, this is equivalent to
set
collectionRef [ #refName:=
value ]