Struct rocfl::ocfl::OcflRepo[][src]

pub struct OcflRepo { /* fields omitted */ }
Expand description

OCFL repository

Implementations

Creates a new OcflRepo instance backed by the local filesystem. storage_root is the location of the OCFL repository to open. The OCFL repository must already exist.

Initializes a new OcflRepo instance backed by the local filesystem. The OCFL repository most not already exist.

Initializes a new OcflRepo instance backed by S3. The OCFL repository most not already exist.

Creates a new OcflRepo instance backed by S3. prefix used to specify a sub directory within a bucket that the OCFL repository is rooted in.

Instructs the repo to gracefully stop any in-flight work and not accept any additional requests.

Validates the specified object and returns any problems found. Err will only be returned if a non-validation problem was encountered.

Validates the specified object at the specified path, relative the storage root, and returns any problems found. Err will only be returned if a non-validation problem was encountered.

Validates the structure of an OCFL repository as well as all of the objects in the repository When fixity_check is false, then the digests of object content files are not validated.

The storage root is validated immediately, and an incremental validator is returned that is used to lazily validate the rest of the repository.

Returns an iterator that iterate through all of the objects in an OCFL repository. Objects are lazy-loaded. An optional glob pattern may be provided to filter the objects that are returned.

The iterator returns an error if it encounters a problem accessing an object. This does terminate the iterator; there are still more objects until it returns None.

Returns an iterator that iterate through all of the staged objects in an OCFL repository. Objects are lazy-loaded. An optional glob pattern may be provided to filter the objects that are returned.

The iterator returns an error if it encounters a problem accessing an object. This does terminate the iterator; there are still more objects until it returns None.

Returns a view of a version of an object. If a VersionNum is not specified, then the head version of the object is returned.

If the object or version of the object cannot be found, then a RocflError::NotFound error is returned.

Same as get_object() except that it returns the staged version of an object.

If the object does not have a staged version, then a RocflError::NotFound error is returned.

Returns high-level details about an object version. This method is similar to OcflRepo::get_object() except that it does less processing and does not include the version’s state.

If the object or version of the object cannot be found, then a RocflError::NotFound error is returned.

Same as get_object_details(), but for the staged version of an object.

If the object does not have a staged version, then a RocflError::NotFound error is returned.

Returns a vector containing the version metadata for ever version of an object. The vector is sorted in ascending order.

If the object cannot be found, then a RocflError::NotFound error is returned.

Writes the specified file to the sink.

If the file cannot be found, then a RocflError::NotFound error is returned.

Writes the specified file from the staged version of the object to the sink.

If the file cannot be found, then a RocflError::NotFound error is returned.

Returns a vector contain the version metadata for every version of an object that affected the specified file. The vector is sorted in ascending order.

If the object or path cannot be found, then a `RocflError::NotFound’ error is returned.

Returns the diff of two object versions. If only one version is specified, then the diff is between the specified version and the version before it.

If the object cannot be found, then a RocflError::NotFound error is returned.

Returns all of the staged changes to the specified object, if there are any.

Completely removes the specified object from the repository. If the object doest not exist, nothing happens.

Stages a new OCFL object if there is not an existing object with the same ID. The object is not inserted into the repository until it is committed.

Copies files from outside the OCFL repository into the specified OCFL object. A destination of / specifies the object’s root.

Copies files within an OCFL object. The source paths may be glob patterns.

Moves files from outside the OCFL repository into the specified OCFL object. A destination of / specifies the object’s root.

Moves files within an OCFL object. The source paths may be glob patterns.

Removes the specified files from the staged version of the object. The files still exist in prior versions.

Reset all staged changes for an object by dropping the object’s staged version completely.

Resets to specified staged changes to an object. Paths may be a glob and is resolved against both the staged version and the previous version. Matches in the staged version are treated as add/update resets and matches in the previous version are treated as remove resets.

Commits all of an object’s staged changes. If user_address is provided, then user_name must also be. If created is not provided, then it defaults to the current time.

object_root may be specified to define the storage root relative path to the object’s root. This value is only respected if the object does not already exist, and the repo does not have defined storage layout.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more