Struct cfdp::filestore::std_mod::NativeFilestore

source ·
pub struct NativeFilestore {}
Available on crate features alloc and std only.

Implementations§

Trait Implementations§

source§

impl Default for NativeFilestore

source§

fn default() -> NativeFilestore

Returns the “default value” for a type. Read more
source§

impl VirtualFilestore for NativeFilestore

source§

fn create_file(&self, file_path: &str) -> Result<(), FilestoreError>

source§

fn remove_file(&self, file_path: &str) -> Result<(), FilestoreError>

source§

fn file_name<'a>( &self, full_path: &'a str, ) -> Result<Option<&'a str>, FilestoreError>

Extract the file name part of a full path. Read more
source§

fn truncate_file(&self, file_path: &str) -> Result<(), FilestoreError>

Truncating a file means deleting all its data so the resulting file is empty. This can be more efficient than removing and re-creating a file.
source§

fn create_dir(&self, dir_path: &str) -> Result<(), FilestoreError>

source§

fn remove_dir(&self, dir_path: &str, all: bool) -> Result<(), FilestoreError>

source§

fn read_data( &self, file_name: &str, offset: u64, read_len: u64, buf: &mut [u8], ) -> Result<(), FilestoreError>

source§

fn write_data( &self, file: &str, offset: u64, buf: &[u8], ) -> Result<(), FilestoreError>

source§

fn is_file(&self, str_path: &str) -> Result<bool, FilestoreError>

source§

fn exists(&self, path: &str) -> Result<bool, FilestoreError>

source§

fn file_size(&self, str_path: &str) -> Result<u64, FilestoreError>

source§

fn calculate_checksum( &self, file_path: &str, checksum_type: ChecksumType, size_to_verify: u64, verification_buf: &mut [u8], ) -> Result<u32, FilestoreError>

This special function is the CFDP specific abstraction to calculate the checksum of a file. This allows to keep OS specific details like reading the whole file in the most efficient manner inside the file system abstraction. Read more
source§

fn filename_from_full_path(path: &str) -> Option<&str>
where Self: Sized,

source§

fn is_dir(&self, path: &str) -> Result<bool, FilestoreError>

source§

fn checksum_verify( &self, expected_checksum: u32, file_path: &str, checksum_type: ChecksumType, size_to_verify: u64, verification_buf: &mut [u8], ) -> Result<bool, FilestoreError>

This special function is the CFDP specific abstraction to verify the checksum of a file. This allows to keep OS specific details like reading the whole file in the most efficient manner inside the file system abstraction. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.