pub struct EncryptedFilesystem { /* private fields */ }Expand description
At-rest encryption wrapper implementing Filesystem around an inner
filesystem. See the module docs for format, migration, and exemptions.
Implementations§
Source§impl EncryptedFilesystem
impl EncryptedFilesystem
Sourcepub fn new(inner: SharedFilesystem, key: &[u8; 32]) -> Self
pub fn new(inner: SharedFilesystem, key: &[u8; 32]) -> Self
Wrap inner with at-rest AES-256-GCM under key (32 bytes — in
the browser app, crate::wallet::at_rest_key_from_entropy).
Sourcepub fn looks_sealed(bytes: &[u8]) -> bool
pub fn looks_sealed(bytes: &[u8]) -> bool
Whether bytes carry the sealed-file shape (magic + minimum length).
Trait Implementations§
Source§impl Debug for EncryptedFilesystem
impl Debug for EncryptedFilesystem
Source§impl Filesystem for EncryptedFilesystem
impl Filesystem for EncryptedFilesystem
Source§fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read the full contents of a file as bytes. Read more
Source§fn write_atomic<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 str,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write_atomic<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 str,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Atomically write
bytes to path, creating any missing parent
directories. Replaces any existing file at the destination. Read moreSource§fn metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Metadata>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Metadata>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return metadata for
path, or None if the path does not exist.
Other I/O errors (e.g. permission denied) propagate as Err.Source§fn read_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<DirEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<DirEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List the immediate children of
path, sorted by name. Read moreSource§fn walk<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
max_depth: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<WalkEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn walk<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
max_depth: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<WalkEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Recursively walk
path, returning every entry under it (files
and directories). Symlinks are not followed. If max_depth is
Some(d), recursion is limited to depth d (the root itself is
depth 0). Implementations may return entries in any order.Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete
path. If path names a directory, the directory and
all its contents are removed (recursive). If path does not
exist, returns Err. Symlinks are removed, not followed.Source§fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 str,
to: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 str,
to: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Rename / move
from to to. Both arguments are relative paths
in the backend’s address space. If to already exists, the
behaviour is backend-defined (native uses platform default;
OPFS errors out). Read moreAuto Trait Implementations§
impl !RefUnwindSafe for EncryptedFilesystem
impl !UnwindSafe for EncryptedFilesystem
impl Freeze for EncryptedFilesystem
impl Send for EncryptedFilesystem
impl Sync for EncryptedFilesystem
impl Unpin for EncryptedFilesystem
impl UnsafeUnpin for EncryptedFilesystem
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