pub struct MCardCollection { /* private fields */ }Expand description
Carrier collection interface for MCard operations across runtimes (INV-552).
Implementations§
Source§impl MCardCollection
impl MCardCollection
Sourcepub fn new(fs: MCardFileSystem) -> Self
pub fn new(fs: MCardFileSystem) -> Self
Create a collection wrapping an existing MCardFileSystem.
Sourcepub fn new_in_memory() -> Result<Self>
pub fn new_in_memory() -> Result<Self>
Initializes an isolated, in-memory MCardCollection.
Sourcepub fn from_connection(conn: Arc<Mutex<Connection>>) -> Self
pub fn from_connection(conn: Arc<Mutex<Connection>>) -> Self
Wraps an existing shared SQLite connection.
Sourcepub fn fs(&self) -> &MCardFileSystem
pub fn fs(&self) -> &MCardFileSystem
Access the underlying MCardFileSystem.
Sourcepub fn write_raw_bytes(
&self,
uri: &str,
content: &[u8],
algorithm: Option<&str>,
) -> Result<MCardRecord>
pub fn write_raw_bytes( &self, uri: &str, content: &[u8], algorithm: Option<&str>, ) -> Result<MCardRecord>
Writes raw content bytes into card and binds uri in handle_registry (INV-510-01, INV-510-02).
Sourcepub fn read_raw_bytes(&self, uri: &str) -> Result<Vec<u8>>
pub fn read_raw_bytes(&self, uri: &str) -> Result<Vec<u8>>
Reads and verifies exact raw bytes bound to uri (INV-510-01).
Sourcepub fn bind(
&self,
uri: &str,
new_ref: &str,
expected_old_ref: Option<&str>,
) -> Result<bool>
pub fn bind( &self, uri: &str, new_ref: &str, expected_old_ref: Option<&str>, ) -> Result<bool>
Atomic Compare-and-Swap handle binding (INV-510-03).
Sourcepub fn write_directory_manifest(
&self,
dir_uri: &str,
manifest: &DirectoryManifest,
) -> Result<MCardRecord>
pub fn write_directory_manifest( &self, dir_uri: &str, manifest: &DirectoryManifest, ) -> Result<MCardRecord>
Writes a DirectoryManifest MCard to dir_uri (INV-510-04).
Sourcepub fn read_directory_manifest(
&self,
dir_uri: &str,
) -> Result<DirectoryManifest>
pub fn read_directory_manifest( &self, dir_uri: &str, ) -> Result<DirectoryManifest>
Reads a DirectoryManifest MCard from dir_uri (INV-510-04).
Trait Implementations§
Auto Trait Implementations§
impl Forget for MCardCollection
impl Freeze for MCardCollection
impl RefUnwindSafe for MCardCollection
impl Send for MCardCollection
impl Sync for MCardCollection
impl Unpin for MCardCollection
impl UnsafeUnpin for MCardCollection
impl UnwindSafe for MCardCollection
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