gi-ostree-1.0.19: OSTree bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.OSTree.Objects.MutableTree

Description

Private instance structure.

Synopsis

Exported types

newtype MutableTree Source #

Memory-managed wrapper type.

Constructors

MutableTree (ManagedPtr MutableTree) 

Instances

Instances details
Eq MutableTree Source # 
Instance details

Defined in GI.OSTree.Objects.MutableTree

GObject MutableTree Source # 
Instance details

Defined in GI.OSTree.Objects.MutableTree

ManagedPtrNewtype MutableTree Source # 
Instance details

Defined in GI.OSTree.Objects.MutableTree

Methods

toManagedPtr :: MutableTree -> ManagedPtr MutableTree

TypedObject MutableTree Source # 
Instance details

Defined in GI.OSTree.Objects.MutableTree

Methods

glibType :: IO GType

HasParentTypes MutableTree Source # 
Instance details

Defined in GI.OSTree.Objects.MutableTree

IsGValue (Maybe MutableTree) Source #

Convert MutableTree to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.OSTree.Objects.MutableTree

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe MutableTree -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe MutableTree)

type ParentTypes MutableTree Source # 
Instance details

Defined in GI.OSTree.Objects.MutableTree

type ParentTypes MutableTree = '[Object]

class (GObject o, IsDescendantOf MutableTree o) => IsMutableTree o Source #

Type class for types which can be safely cast to MutableTree, for instance with toMutableTree.

Instances

Instances details
(GObject o, IsDescendantOf MutableTree o) => IsMutableTree o Source # 
Instance details

Defined in GI.OSTree.Objects.MutableTree

toMutableTree :: (MonadIO m, IsMutableTree o) => o -> m MutableTree Source #

Cast to MutableTree, for types for which this is known to be safe. For general casts, use castTo.

Methods

checkError

mutableTreeCheckError Source #

Arguments

:: (HasCallStack, MonadIO m, IsMutableTree a) 
=> a

self: Tree

-> m ()

(Can throw GError)

In some cases, a tree may be in a "lazy" state that loads data in the background; if an error occurred during a non-throwing API call, it will have been cached. This function checks for a cached error. The tree remains in error state.

Since: 2018.7

ensureDir

mutableTreeEnsureDir Source #

Arguments

:: (HasCallStack, MonadIO m, IsMutableTree a) 
=> a

self: Tree

-> Text

name: Name of subdirectory of self to retrieve/creates

-> m MutableTree

(Can throw GError)

Returns the subdirectory of self with filename name, creating an empty one it if it doesn't exist.

ensureParentDirs

mutableTreeEnsureParentDirs Source #

Arguments

:: (HasCallStack, MonadIO m, IsMutableTree a) 
=> a

self: Tree

-> [Text]

splitPath: File path components

-> Text

metadataChecksum: SHA256 checksum for metadata

-> m MutableTree

(Can throw GError)

Create all parent trees necessary for the given splitPath to exist.

fillEmptyFromDirtree

mutableTreeFillEmptyFromDirtree Source #

Arguments

:: (HasCallStack, MonadIO m, IsMutableTree a, IsRepo b) 
=> a 
-> b 
-> Text 
-> Text 
-> m Bool

Returns: tRUE if merge was successful, fALSE if it was not possible.

This function enables optimisations when composing trees. The provided checksums are not loaded or checked when this function is called. Instead the contents will be loaded only when needed.

Merges self with the tree given by contentsChecksum and metadataChecksum, but only if it's possible without writing new objects to the repo. We can do this if either self is empty, the tree given by contentsChecksum is empty or if both trees already have the same contentsChecksum.

Since: 2018.7

getContentsChecksum

mutableTreeGetContentsChecksum :: (HasCallStack, MonadIO m, IsMutableTree a) => a -> m Text Source #

No description available in the introspection data.

getFiles

mutableTreeGetFiles Source #

Arguments

:: (HasCallStack, MonadIO m, IsMutableTree a) 
=> a 
-> m (Map Text Text)

Returns: All children files (the value is a checksum)

No description available in the introspection data.

getMetadataChecksum

mutableTreeGetMetadataChecksum :: (HasCallStack, MonadIO m, IsMutableTree a) => a -> m Text Source #

No description available in the introspection data.

lookup

mutableTreeLookup Source #

Arguments

:: (HasCallStack, MonadIO m, IsMutableTree a) 
=> a

self: Tree

-> Text

name: name

-> m (Maybe Text, Maybe MutableTree)

(Can throw GError)

Lookup name and returns outFileChecksum or outSubdir depending on its file type.

new

mutableTreeNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m MutableTree

Returns: A new tree

No description available in the introspection data.

newFromChecksum

mutableTreeNewFromChecksum Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

repo: The repo which contains the objects refered by the checksums.

-> Text

contentsChecksum: dirtree checksum

-> Text

metadataChecksum: dirmeta checksum

-> m MutableTree

Returns: A new tree

Creates a new OstreeMutableTree with the contents taken from the given repo and checksums. The data will be loaded from the repo lazily as needed.

Since: 2018.7

newFromCommit

mutableTreeNewFromCommit Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

repo: The repo which contains the objects refered by the checksums.

-> Text

rev: ref or SHA-256 checksum

-> m MutableTree

Returns: A new tree (Can throw GError)

Creates a new OstreeMutableTree with the contents taken from the given commit. The data will be loaded from the repo lazily as needed.

Since: 2021.5

remove

mutableTreeRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsMutableTree a) 
=> a

self: Tree

-> Text

name: Name of file or subdirectory to remove

-> Bool

allowNoent: If fALSE, an error will be thrown if name does not exist in the tree

-> m ()

(Can throw GError)

Remove the file or subdirectory named name from the mutable tree self.

Since: 2018.9

replaceFile

mutableTreeReplaceFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsMutableTree a) 
=> a 
-> Text 
-> Text 
-> m ()

(Can throw GError)

No description available in the introspection data.

setContentsChecksum

mutableTreeSetContentsChecksum :: (HasCallStack, MonadIO m, IsMutableTree a) => a -> Text -> m () Source #

No description available in the introspection data.

setMetadataChecksum

mutableTreeSetMetadataChecksum :: (HasCallStack, MonadIO m, IsMutableTree a) => a -> Text -> m () Source #

No description available in the introspection data.

walk

mutableTreeWalk Source #

Arguments

:: (HasCallStack, MonadIO m, IsMutableTree a) 
=> a

self: Tree

-> [Text]

splitPath: Split pathname

-> Word32

start: Descend from this number of elements in splitPath

-> m MutableTree

(Can throw GError)

Traverse start number of elements starting from splitPath; the child will be returned in outSubdir.