Skip to main content

Filesystem

Trait Filesystem 

Source
pub trait Filesystem: Send + Sync {
Show 28 methods // Required methods fn info(&self) -> FilesystemInfo; fn cwd(&self) -> &str; fn placement<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Placement, FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn read_regular<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, work: Option<Arc<WorkBudget>>, path: &'life1 str, maximum_bytes: u64, limits: &'life2 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<FileContents, FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn directory_names<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, work: Option<Arc<WorkBudget>>, path: &'life1 str, maximum_entries: usize, limits: &'life2 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<DirectoryNames, FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn begin_download<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect: &'life1 EffectId, path: &'life2 str, options: DownloadOptions, work: Arc<WorkBudget>, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Download>, FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn begin_file_update<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, path: &'life2 str, request: [u8; 32], limits: &'life3 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn FileUpdate>, FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn metadata<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, follow: bool, ) -> Pin<Box<dyn Future<Output = Result<Metadata, FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn read<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, offset: u64, maximum_bytes: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn write<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, bytes: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn append<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, bytes: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn mkdir<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, recursive: bool, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn remove<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, recursive: bool, budget: &'life3 mut dyn MutationBudget, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn move_entry<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, from: &'life2 str, to: &'life3 str, budget: &'life4 mut dyn MutationBudget, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait; fn copy<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, from: &'life2 str, to: &'life3 str, recursive: bool, budget: &'life4 mut dyn MutationBudget, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait; fn next_reader<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, reader: &'life2 mut FileReader, limits: &'life3 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<ReadOutput, FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn close_reader<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, reader: &'life2 mut FileReader, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn next_directory<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, directory: &'life2 mut DirectoryReader, limits: &'life3 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<Option<DirectoryEntry>, FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn close_directory<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, directory: &'life2 mut DirectoryReader, limits: &'life3 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn write_chunk<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, writer: &'life2 mut FileWriter, bytes: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn close_writer<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, writer: &'life2 mut FileWriter, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn open_reader<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, options: ReaderOptions, ) -> Pin<Box<dyn Future<Output = Result<FileReader, FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn open_directory<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, recursive: bool, limits: &'life3 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<DirectoryReader, FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn open_writer<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<FileWriter, FilesystemError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; // Provided methods fn supports_download_replay(&self) -> bool { ... } fn supports_update_replay(&self) -> bool { ... } fn supports_resource_replay(&self) -> bool { ... } fn path_cost(&self, _path: &str) -> u64 { ... }
}

Required Methods§

Source

fn info(&self) -> FilesystemInfo

Source

fn cwd(&self) -> &str

Source

fn placement<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Placement, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolving placement may follow filesystem links and must not block the host.

Source

fn read_regular<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, work: Option<Arc<WorkBudget>>, path: &'life1 str, maximum_bytes: u64, limits: &'life2 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<FileContents, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Whole regular-file observation, with nonblocking special-file refusal.

Source

fn directory_names<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, work: Option<Arc<WorkBudget>>, path: &'life1 str, maximum_entries: usize, limits: &'life2 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<DirectoryNames, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Names only: the caller checks each child’s authority before its metadata. This transient observation is not a guest-visible persistent iterator.

Source

fn begin_download<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect: &'life1 EffectId, path: &'life2 str, options: DownloadOptions, work: Arc<WorkBudget>, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Download>, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Admit the destination and return fresh disposable staging, retaining native serialization until publication or drop. Completion belongs to effect history.

Source

fn begin_file_update<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, path: &'life2 str, request: [u8; 32], limits: &'life3 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn FileUpdate>, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Open a replacement and return any captured result before native preparation. The returned operation retains the backend’s serialization until publication finishes or the caller drops it without publishing.

Source

fn metadata<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, follow: bool, ) -> Pin<Box<dyn Future<Output = Result<Metadata, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn read<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, offset: u64, maximum_bytes: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn write<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, bytes: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Atomically replace the file contents, creating the file if it is missing.

Source

fn append<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, bytes: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Append bytes to the file, creating the file if it is missing.

Source

fn mkdir<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, recursive: bool, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn remove<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, recursive: bool, budget: &'life3 mut dyn MutationBudget, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn move_entry<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, from: &'life2 str, to: &'life3 str, budget: &'life4 mut dyn MutationBudget, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Source

fn copy<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, from: &'life2 str, to: &'life3 str, recursive: bool, budget: &'life4 mut dyn MutationBudget, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Source

fn next_reader<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, reader: &'life2 mut FileReader, limits: &'life3 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<ReadOutput, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn close_reader<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, reader: &'life2 mut FileReader, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn next_directory<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, directory: &'life2 mut DirectoryReader, limits: &'life3 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<Option<DirectoryEntry>, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn close_directory<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, directory: &'life2 mut DirectoryReader, limits: &'life3 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn write_chunk<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, writer: &'life2 mut FileWriter, bytes: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn close_writer<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, writer: &'life2 mut FileWriter, ) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Only explicit close publishes. Dropping a resource never publishes it.

Source

fn open_reader<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, options: ReaderOptions, ) -> Pin<Box<dyn Future<Output = Result<FileReader, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn open_directory<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, recursive: bool, limits: &'life3 TenantLimits, ) -> Pin<Box<dyn Future<Output = Result<DirectoryReader, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn open_writer<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, effect_id: &'life1 EffectId, work: Option<Arc<WorkBudget>>, path: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<FileWriter, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

Source

fn supports_download_replay(&self) -> bool

Download admission survives retry with the same effect identity.

Source

fn supports_update_replay(&self) -> bool

File updates retain prepared bytes/results and completed receipts across retries.

Source

fn supports_resource_replay(&self) -> bool

Whether resources can be used after decoding without their local handles.

Source

fn path_cost(&self, _path: &str) -> u64

Additional fuel to admit before resolving a guest path.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§