pub struct VmgsClient { /* private fields */ }Expand description
Client to interact with a backend-agnostic VMGS instance.
Implementations§
Source§impl VmgsClient
impl VmgsClient
Sourcepub async fn get_file_info(
&self,
file_id: FileId,
) -> Result<VmgsFileInfo, VmgsClientError>
pub async fn get_file_info( &self, file_id: FileId, ) -> Result<VmgsFileInfo, VmgsClientError>
Get allocated and valid bytes from File Control Block for file_id.
Sourcepub async fn read_file(
&self,
file_id: FileId,
) -> Result<Vec<u8>, VmgsClientError>
pub async fn read_file( &self, file_id: FileId, ) -> Result<Vec<u8>, VmgsClientError>
Reads the specified file_id.
Sourcepub async fn write_file(
&self,
file_id: FileId,
buf: Vec<u8>,
) -> Result<(), VmgsClientError>
pub async fn write_file( &self, file_id: FileId, buf: Vec<u8>, ) -> Result<(), VmgsClientError>
Writes buf to a file_id.
NOTE: It is an error to overwrite a previously encrypted FileId with plaintext data.
Sourcepub async fn write_file_encrypted(
&self,
file_id: FileId,
buf: Vec<u8>,
) -> Result<(), VmgsClientError>
pub async fn write_file_encrypted( &self, file_id: FileId, buf: Vec<u8>, ) -> Result<(), VmgsClientError>
If VMGS has been configured with encryption, encrypt + write bug to
the specified file_id. Otherwise, perform a regular plaintext write
instead.
Sourcepub async fn save(&self) -> Result<SavedVmgsState, VmgsClientError>
pub async fn save(&self) -> Result<SavedVmgsState, VmgsClientError>
Save the in-memory VMGS file metadata.
This saved state can be used alongside open_from_saved to obtain a
new Vmgs instance without needing to invoke any IOs on the
underlying storage.
Trait Implementations§
Source§impl CanResolveTo<VmgsClient> for VmgsClientKind
impl CanResolveTo<VmgsClient> for VmgsClientKind
Source§impl Clone for VmgsClient
impl Clone for VmgsClient
Source§fn clone(&self) -> VmgsClient
fn clone(&self) -> VmgsClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl DefaultEncoding for VmgsClient
impl DefaultEncoding for VmgsClient
Source§impl<'encoding> StructDecodeMetadata<'encoding, Resource> for VmgsClient
impl<'encoding> StructDecodeMetadata<'encoding, Resource> for VmgsClient
Source§impl StructEncodeMetadata<Resource> for VmgsClient
impl StructEncodeMetadata<Resource> for VmgsClient
Auto Trait Implementations§
impl Freeze for VmgsClient
impl !RefUnwindSafe for VmgsClient
impl Send for VmgsClient
impl Sync for VmgsClient
impl Unpin for VmgsClient
impl !UnwindSafe for VmgsClient
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> MeshField for T
impl<T> MeshField for T
§impl<T> MeshPayload for T
impl<T> MeshPayload for T
§impl<T> SerializeMessage for Twhere
T: 'static + MeshPayload + Send,
impl<T> SerializeMessage for Twhere
T: 'static + MeshPayload + Send,
§fn compute_message_size(&mut self, sizer: MessageSizer<'_>)
fn compute_message_size(&mut self, sizer: MessageSizer<'_>)
Computes the message size, as in [
MessageEncode::compute_message_size].§fn write_message(self, writer: MessageWriter<'_, '_, Resource>)
fn write_message(self, writer: MessageWriter<'_, '_, Resource>)
Writes the message, as in [
MessageEncode::write_message].