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 reflog.
Synopsis
- newtype Reflog = Reflog (ManagedPtr Reflog)
- noReflog :: Maybe Reflog
- reflogAppend :: (HasCallStack, MonadIO m, IsSignature a) => Reflog -> OId -> a -> Text -> m ()
- reflogGetEntryCount :: (HasCallStack, MonadIO m) => Reflog -> m Word32
- reflogGetEntryFromIndex :: (HasCallStack, MonadIO m) => Reflog -> Word32 -> m (Maybe ReflogEntry)
- reflogRef :: (HasCallStack, MonadIO m) => Reflog -> m (Maybe Reflog)
- reflogRename :: (HasCallStack, MonadIO m) => Reflog -> Text -> m ()
- reflogUnref :: (HasCallStack, MonadIO m) => Reflog -> m ()
- reflogWrite :: (HasCallStack, MonadIO m) => Reflog -> m ()
Exported types
Memory-managed wrapper type.
Instances
BoxedObject Reflog Source # | |
Methods
append
:: (HasCallStack, MonadIO m, IsSignature a) | |
=> Reflog |
|
-> OId |
|
-> a |
|
-> Text |
|
-> m () | (Can throw |
Creates a reflog entry.
getEntryCount
:: (HasCallStack, MonadIO m) | |
=> Reflog |
|
-> m Word32 | Returns: the number of log entries. |
Gets the number of log entries in reflog
.
getEntryFromIndex
reflogGetEntryFromIndex Source #
:: (HasCallStack, MonadIO m) | |
=> Reflog |
|
-> Word32 |
|
-> m (Maybe ReflogEntry) | Returns: the reflog entry at the index, or |
Gets the ReflogEntry
at idx
in reflog
, or Nothing
if not found.
ref
Atomically increments the reference count of reflog
by one.
This function is MT-safe and may be called from any thread.
rename
:: (HasCallStack, MonadIO m) | |
=> Reflog |
|
-> Text |
|
-> m () | (Can throw |
Renames the reflog for to newName
, on error error
is set.
unref
:: (HasCallStack, MonadIO m) | |
=> Reflog |
|
-> m () |
Atomically decrements the reference count of reflog
by one.
If the reference count drops to 0, reflog
is freed.
write
:: (HasCallStack, MonadIO m) | |
=> Reflog |
|
-> m () | (Can throw |
Write the reflog to disk.