Be aware: Foundation will NEVER ask for your seed words, device PIN, or call you unexpectedly. If anyone does, it's a scam.

Trait

FileAdapter

pub trait FileAdapter<P: CheckedPermissions>:
    Read
    + Write
    + Seek {
    // Required methods
    fn metadata(&self) -> Result<Metadata, Error>
       where P: MessageAllowed<GetMetadata>;
    fn truncate(&mut self) -> Result<(), Error>
       where P: MessageAllowed<TruncateFile>;
    fn set_mtime(&mut self, datetime: DateTime) -> Result<(), Error>
       where P: MessageAllowed<SetMtime>;
    fn copy_block_to(
        &mut self,
        to: &mut Self,
        len: usize,
    ) -> Result<usize, Error>
       where P: MessageAllowed<AsyncCopyBlock>;
}

Required Methods

fn metadata(&self) -> Result<Metadata, Error>
where P: MessageAllowed<GetMetadata>,

Permission: os/fs / GetMetadata

Permission group: file-system.read-handles

Required signature: thirdParty

Approval: autoAllow

fn truncate(&mut self) -> Result<(), Error>
where P: MessageAllowed<TruncateFile>,

Permission: os/fs / TruncateFile

Permission group: file-system.write-and-mutate

Required signature: thirdParty

Approval: autoAllow

fn set_mtime(&mut self, datetime: DateTime) -> Result<(), Error>
where P: MessageAllowed<SetMtime>,

Permission: os/fs / SetMtime

Permission group: file-system.write-and-mutate

Required signature: thirdParty

Approval: autoAllow

fn copy_block_to(&mut self, to: &mut Self, len: usize) -> Result<usize, Error>
where P: MessageAllowed<AsyncCopyBlock>,

Permission: os/fs / AsyncCopyBlock

Permission group: file-system.write-and-mutate

Required signature: thirdParty

Approval: autoAllow

Dyn Compatibility

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors

impl<P> FileAdapter<P> for File<P>
where P: CheckedPermissions + MessageAllowed<CloseFile> + MessageAllowed<ReadFile> + MessageAllowed<WriteFile> + MessageAllowed<Flush> + MessageAllowed<SeekFile>,