[−][src]Struct rocfl::OcflRepo
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]
&self,
filter_glob: Option<&str>
) -> Result<Box<dyn Iterator<Item = Result<ObjectVersionDetails>>>>
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]
&self,
object_id: &str,
version_num: Option<&VersionNum>
) -> Result<ObjectVersion>
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]
&self,
object_id: &str,
version_num: Option<&VersionNum>
) -> Result<ObjectVersionDetails>
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]
&self,
object_id: &str
) -> Result<Vec<VersionDetails>>
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]
&self,
object_id: &str,
path: &str
) -> Result<Vec<VersionDetails>>
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: Option<&VersionNum>,
right_version: &VersionNum
) -> Result<Vec<Diff>>
[src]
&self,
object_id: &str,
left_version: Option<&VersionNum>,
right_version: &VersionNum
) -> Result<Vec<Diff>>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,