pub struct FileSystem<P: CheckedPermissions> { /* private fields */ }Expand description
Implementations§
Source§impl<P: CheckedPermissions> FileSystem<P>
impl<P: CheckedPermissions> FileSystem<P>
pub fn open_file( &self, path: impl Into<String>, location: Location, flags: OpenFlags, ) -> Result<File<P>, Error>
pub fn open_dir( &self, path: impl Into<String>, location: Location, ) -> Result<Dir<P>, Error>
pub fn create_dir( &self, path: impl Into<String>, location: Location, ) -> Result<Dir<P>, Error>
pub fn create_dir_async( &self, path: impl Into<String>, location: Location, ) -> Result<CreateDirMessage, Error>
pub fn ensure_parent_dir_exists( &self, path: &str, location: Location, ) -> Result<(), Error>
pub fn remove(
&self,
path: impl Into<String>,
location: Location,
) -> Result<(), Error>where
P: MessageAllowed<Remove>,
pub fn remove_async(
&self,
path: impl Into<String>,
location: Location,
) -> Result<Remove, Error>where
P: MessageAllowed<Remove>,
Sourcepub fn atomic_copy(
&self,
src: impl Into<String>,
dest_dir: impl Into<String>,
rename: Option<impl Into<String>>,
location: Location,
) -> Result<(), Error>where
P: MessageAllowed<AtomicCopy>,
pub fn atomic_copy(
&self,
src: impl Into<String>,
dest_dir: impl Into<String>,
rename: Option<impl Into<String>>,
location: Location,
) -> Result<(), Error>where
P: MessageAllowed<AtomicCopy>,
Copy a source file/directory to a destination directory. If source is a directory, the copy is recursive.
Optionally, the copied file/directory can be renamed by providing the rename argument.
The destination directory must be empty; copying into a non-empty directory returns
Error::FileAlreadyExists.
pub fn metadata(
&self,
path: impl Into<String>,
location: Location,
) -> Result<Metadata, Error>where
P: MessageAllowed<GetMetadata>,
pub fn rename(
&self,
from: impl Into<String>,
to: impl Into<String>,
location: Location,
) -> Result<(), Error>where
P: MessageAllowed<Rename>,
pub fn rename_async(
&self,
from: impl Into<String>,
to: impl Into<String>,
location: Location,
) -> Result<Rename, Error>where
P: MessageAllowed<Rename>,
pub fn map_file(
&self,
location: Location,
path: impl Into<String>,
) -> Result<MemoryRange, Error>where
P: MapFilePermissions,
pub fn register_app_resources(
&self,
app_id: AppId,
root: AppResourcesRoot,
app_dir: impl Into<String>,
) -> Result<(), Error>where
P: MessageAllowed<RegisterAppResources>,
pub fn read_blocks(
&mut self,
location: Location,
block_index: u32,
block_count: usize,
buf: MemoryRange,
) -> Result<usize, Error>where
P: MessageAllowed<ReadBlocks>,
pub fn write_blocks(
&mut self,
location: Location,
block_index: u32,
block_count: usize,
buf: MemoryRange,
) -> Result<usize, Error>where
P: MessageAllowed<WriteBlocks>,
pub fn flush(&mut self, location: Location) -> Result<(), Error>where
P: MessageAllowed<FlushFs>,
pub fn block_count(&self, location: Location) -> Result<usize, Error>where
P: MessageAllowed<BlockCount>,
pub fn format_encrypted_volume(&self)where
P: MessageAllowed<FormatEncryptedVolume>,
pub fn subscribe_filesystem_events<S>( &self, listener: &mut ServerContext<S>, location: Location, )
pub fn wait_for_filesystem(&self, location: Location)where
P: 'static + MessageAllowed<SubscribeFilesystemEvent>,
pub fn mount_airlock(&mut self) -> Result<(), Error>where
P: MessageAllowed<MountAirlock>,
pub fn unmount_airlock(&mut self) -> Result<(), Error>where
P: MessageAllowed<MountAirlock>,
pub fn format_airlock(&mut self) -> Result<(), Error>where
P: MessageAllowed<FormatAirlock>,
Trait Implementations§
Source§impl<P: Clone + CheckedPermissions> Clone for FileSystem<P>
impl<P: Clone + CheckedPermissions> Clone for FileSystem<P>
Source§fn clone(&self) -> FileSystem<P>
fn clone(&self) -> FileSystem<P>
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<P: Debug + CheckedPermissions> Debug for FileSystem<P>
impl<P: Debug + CheckedPermissions> Debug for FileSystem<P>
Source§impl<P: Default + CheckedPermissions> Default for FileSystem<P>
impl<P: Default + CheckedPermissions> Default for FileSystem<P>
Source§fn default() -> FileSystem<P>
fn default() -> FileSystem<P>
Returns the “default value” for a type. Read more
Source§impl<P> FsAdapter for FileSystem<P>where
P: CheckedPermissions + MessageAllowed<CloseFile> + MessageAllowed<CloseDir> + MessageAllowed<NextEntry> + MessageAllowed<ReadFile> + MessageAllowed<WriteFile> + MessageAllowed<Flush> + MessageAllowed<SeekFile>,
impl<P> FsAdapter for FileSystem<P>where
P: CheckedPermissions + MessageAllowed<CloseFile> + MessageAllowed<CloseDir> + MessageAllowed<NextEntry> + MessageAllowed<ReadFile> + MessageAllowed<WriteFile> + MessageAllowed<Flush> + MessageAllowed<SeekFile>,
type DirIter = DirIterator<P>
type File = File<P>
type Permissions = P
fn create_dir(&self, path: &str, location: Location) -> Result<(), Error>
fn remove(&self, path: &str, location: Location) -> Result<(), Error>where
P: MessageAllowed<Remove>,
fn atomic_copy(
&self,
src: &str,
dest: &str,
rename: Option<String>,
location: Location,
) -> Result<(), Error>where
P: MessageAllowed<AtomicCopy>,
fn open_file( &self, path: &str, location: Location, flags: OpenFlags, ) -> Result<Self::File, Error>
fn open_dir( &self, path: &str, location: Location, ) -> Result<Self::DirIter, Error>
fn metadata(&self, path: &str, location: Location) -> Result<Metadata, Error>
fn rename(&self, src: &str, dest: &str, location: Location) -> Result<(), Error>where
P: MessageAllowed<Rename>,
fn flush(&mut self, location: Location) -> Result<(), Error>where
P: MessageAllowed<FlushFs>,
fn walk_dir(
&self,
path: &str,
location: Location,
) -> Result<DirWalker<Self>, Error>where
Self: Clone,
Self::Permissions: MessageAllowed<OpenDirMessage> + MessageAllowed<CloseDir> + MessageAllowed<NextEntry>,
fn ensure_parent_dir_exists( &self, path: &str, location: Location, ) -> Result<(), Error>
fn remove_if_exists(&self, path: &str, location: Location) -> Result<(), Error>
Auto Trait Implementations§
impl<P> !Freeze for FileSystem<P>
impl<P> RefUnwindSafe for FileSystem<P>
impl<P> Send for FileSystem<P>
impl<P> Sync for FileSystem<P>
impl<P> Unpin for FileSystem<P>
impl<P> UnwindSafe for FileSystem<P>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.