pub struct CatLib { /* private fields */ }Implementations§
Trait Implementations§
Source§impl CatLib for CatLib
impl CatLib for CatLib
Source§fn create_forest(
&self,
owner: Identity,
signers: Signers,
data: Vec<u8>,
) -> CatlibResult<Arc<Mutex<dyn ForestManifest>>>
fn create_forest( &self, owner: Identity, signers: Signers, data: Vec<u8>, ) -> CatlibResult<Arc<Mutex<dyn ForestManifest>>>
§Errors
Returns RustbreakError cast on CatlibResult upon failure to save to the database.
§Example
let forest_owner = Identity([1; 32]);
let signer = Identity([2; 32]);
let catlib = CatLib::default();
let forest = catlib.create_forest(
forest_owner,
HashSet::from([signer]),
vec![],
).unwrap();Source§fn find_forest(
&self,
owner: &Identity,
) -> CatlibResult<Arc<Mutex<dyn ForestManifest>>>
fn find_forest( &self, owner: &Identity, ) -> CatlibResult<Arc<Mutex<dyn ForestManifest>>>
§Errors
- Returns
CatlibError::NoRecordsFoundif no [Forest] was found. - Returns
CatlibError::MalformedDatabaseRecordif more than one [Forest] was found. - Returns
RustbreakErrorcast onCatlibResultupon failure to save to the database.
Source§fn find_storages_with_template(
&self,
template_id: &Uuid,
) -> CatlibResult<Vec<Arc<Mutex<dyn StorageManifest>>>>
fn find_storages_with_template( &self, template_id: &Uuid, ) -> CatlibResult<Vec<Arc<Mutex<dyn StorageManifest>>>>
§Errors
- Returns
CatlibError::NoRecordsFoundif no [Storage] was found. - Returns
RustbreakErrorcast onCatlibResultupon failure to save to the database.
Source§fn find_containers_with_template(
&self,
template_id: &Uuid,
) -> CatlibResult<Vec<Arc<Mutex<dyn ContainerManifest>>>>
fn find_containers_with_template( &self, template_id: &Uuid, ) -> CatlibResult<Vec<Arc<Mutex<dyn ContainerManifest>>>>
§Errors
- Returns
CatlibError::NoRecordsFoundif no [Container] was found. - Returns
RustbreakErrorcast onCatlibResultupon failure to save to the database.
Source§fn get_forest(
&self,
uuid: &Uuid,
) -> CatlibResult<Arc<Mutex<dyn ForestManifest>>>
fn get_forest( &self, uuid: &Uuid, ) -> CatlibResult<Arc<Mutex<dyn ForestManifest>>>
Return [
Forest] object by Forest UUID.Source§fn get_container(
&self,
uuid: &Uuid,
) -> CatlibResult<Arc<Mutex<dyn ContainerManifest>>>
fn get_container( &self, uuid: &Uuid, ) -> CatlibResult<Arc<Mutex<dyn ContainerManifest>>>
Return [
Container] object by Container UUID.Source§fn save_storage_template(
&self,
template_id: &Uuid,
value: String,
) -> CatlibResult<()>
fn save_storage_template( &self, template_id: &Uuid, value: String, ) -> CatlibResult<()>
Save StorageTemplate data in CatLib.
Source§fn get_storage_templates_data(&self) -> CatlibResult<Vec<String>>
fn get_storage_templates_data(&self) -> CatlibResult<Vec<String>>
Fetche every StorageTemplate data from CatLib.
Auto Trait Implementations§
impl Freeze for CatLib
impl RefUnwindSafe for CatLib
impl !Send for CatLib
impl !Sync for CatLib
impl Unpin for CatLib
impl UnwindSafe for CatLib
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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