pub struct Storage { /* private fields */ }Implementations§
Source§impl Storage
impl Storage
Sourcepub fn open<P>(path: P, info: UserInfo) -> Result<Storage, Error>
pub fn open<P>(path: P, info: UserInfo) -> Result<Storage, Error>
Open a new storage instance and load its inventory.
Sourcepub fn temporary_repository(
&self,
rid: RepoId,
) -> Result<TempRepository, RepositoryError>
pub fn temporary_repository( &self, rid: RepoId, ) -> Result<TempRepository, RepositoryError>
Create a Repository in a temporary directory.
This is used to prevent other processes accessing it during initialization. Usually, callers will want to move the repository to its destination after initialization in the temporary location.
pub fn path(&self) -> &Path
pub fn repositories_by_id<'a>( &self, rids: impl Iterator<Item = &'a RepoId>, ) -> Result<Vec<RepositoryInfo>, RepositoryError>
pub fn inspect(&self) -> Result<(), RepositoryError>
Trait Implementations§
Source§impl ReadStorage for Storage
impl ReadStorage for Storage
type Repository = Repository
Source§fn contains(&self, rid: &RepoId) -> Result<bool, RepositoryError>
fn contains(&self, rid: &RepoId) -> Result<bool, RepositoryError>
Check whether storage contains a repository.
Source§fn repository(
&self,
rid: RepoId,
) -> Result<<Storage as ReadStorage>::Repository, RepositoryError>
fn repository( &self, rid: RepoId, ) -> Result<<Storage as ReadStorage>::Repository, RepositoryError>
Open or create a read-only repository.
Source§fn repositories(&self) -> Result<Vec<RepositoryInfo>, Error>
fn repositories(&self) -> Result<Vec<RepositoryInfo>, Error>
Return all repositories (public and private).
Source§impl WriteStorage for Storage
impl WriteStorage for Storage
type RepositoryMut = Repository
Source§fn repository_mut(
&self,
rid: RepoId,
) -> Result<<Storage as WriteStorage>::RepositoryMut, RepositoryError>
fn repository_mut( &self, rid: RepoId, ) -> Result<<Storage as WriteStorage>::RepositoryMut, RepositoryError>
Open a read-write repository.
Source§fn create(
&self,
rid: RepoId,
) -> Result<<Storage as WriteStorage>::RepositoryMut, Error>
fn create( &self, rid: RepoId, ) -> Result<<Storage as WriteStorage>::RepositoryMut, Error>
Create a read-write repository.
Auto Trait Implementations§
impl Freeze for Storage
impl RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnwindSafe for Storage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more