Struct cfdp::filestore::std_mod::NativeFilestore
source · pub struct NativeFilestore {}Available on crate features
alloc and std only.Implementations§
source§impl NativeFilestore
impl NativeFilestore
pub fn calc_modular_checksum( &self, file_path: &str, ) -> Result<u32, FilestoreError>
Trait Implementations§
source§impl Default for NativeFilestore
impl Default for NativeFilestore
source§fn default() -> NativeFilestore
fn default() -> NativeFilestore
Returns the “default value” for a type. Read more
source§impl VirtualFilestore for NativeFilestore
impl VirtualFilestore for NativeFilestore
fn create_file(&self, file_path: &str) -> Result<(), FilestoreError>
fn remove_file(&self, file_path: &str) -> Result<(), FilestoreError>
source§fn file_name<'a>(
&self,
full_path: &'a str,
) -> Result<Option<&'a str>, FilestoreError>
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>
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.
fn create_dir(&self, dir_path: &str) -> Result<(), FilestoreError>
fn remove_dir(&self, dir_path: &str, all: bool) -> Result<(), FilestoreError>
fn read_data( &self, file_name: &str, offset: u64, read_len: u64, buf: &mut [u8], ) -> Result<(), FilestoreError>
fn write_data( &self, file: &str, offset: u64, buf: &[u8], ) -> Result<(), FilestoreError>
fn is_file(&self, str_path: &str) -> Result<bool, FilestoreError>
fn exists(&self, path: &str) -> Result<bool, FilestoreError>
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>
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
fn filename_from_full_path(path: &str) -> Option<&str>where
Self: Sized,
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>
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§
impl Freeze for NativeFilestore
impl RefUnwindSafe for NativeFilestore
impl Send for NativeFilestore
impl Sync for NativeFilestore
impl Unpin for NativeFilestore
impl UnwindSafe for NativeFilestore
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