[][src]Struct rocfl::OcflRepo

pub struct OcflRepo { /* fields omitted */ }

Interface for interacting with an OCFL repository

Implementations

impl OcflRepo[src]

pub fn new_fs_repo<P: AsRef<Path>>(storage_root: P) -> Result<Self>[src]

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

pub fn list_objects(
    &self,
    filter_glob: Option<&str>
) -> Result<Box<dyn Iterator<Item = Result<ObjectVersionDetails>>>>
[src]

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 return an error if it encounters a problem accessing an object. This does terminate the iterator; there are still more objects until it returns None.

pub fn get_object(
    &self,
    object_id: &str,
    version_num: Option<&VersionNum>
) -> Result<ObjectVersion>
[src]

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.

pub fn get_object_details(
    &self,
    object_id: &str,
    version_num: Option<&VersionNum>
) -> Result<ObjectVersionDetails>
[src]

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.

pub fn list_object_versions(
    &self,
    object_id: &str
) -> Result<Vec<VersionDetails>>
[src]

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.

pub fn list_file_versions(
    &self,
    object_id: &str,
    path: &str
) -> Result<Vec<VersionDetails>>
[src]

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.

pub fn diff(
    &self,
    object_id: &str,
    left_version: &VersionNum,
    right_version: Option<&VersionNum>
) -> Result<Vec<Diff>>
[src]

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.

Auto Trait Implementations

impl !RefUnwindSafe for OcflRepo

impl !Send for OcflRepo

impl !Sync for OcflRepo

impl Unpin for OcflRepo

impl !UnwindSafe for OcflRepo

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.