pub trait Filesystem: Send + Sync {
Show 18 methods
// Required methods
fn info(&self) -> FilesystemInfo;
fn cwd(&self) -> &str;
fn placement(&self, path: &str) -> Result<Placement, FilesystemError>;
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 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<Box<dyn 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<Box<dyn 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<Box<dyn FileWriter>, FilesystemError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
// Provided methods
fn path_cost(&self, _path: &str) -> u64 { ... }
fn restore_reader(
&self,
_descriptor: ResourceDescriptor,
) -> Result<Box<dyn FileReader>, FilesystemError> { ... }
fn restore_directory(
&self,
_descriptor: ResourceDescriptor,
) -> Result<Box<dyn DirectoryReader>, FilesystemError> { ... }
fn restore_writer(
&self,
_descriptor: ResourceDescriptor,
) -> Result<Box<dyn FileWriter>, FilesystemError> { ... }
}Required Methods§
fn info(&self) -> FilesystemInfo
fn cwd(&self) -> &str
fn placement(&self, path: &str) -> Result<Placement, FilesystemError>
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,
Sourcefn 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 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.
Sourcefn 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 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.
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 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<Box<dyn 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<Box<dyn 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<Box<dyn FileWriter>, FilesystemError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Provided Methods§
Sourcefn path_cost(&self, _path: &str) -> u64
fn path_cost(&self, _path: &str) -> u64
Additional fuel to admit before resolving a guest path.
Sourcefn restore_reader(
&self,
_descriptor: ResourceDescriptor,
) -> Result<Box<dyn FileReader>, FilesystemError>
fn restore_reader( &self, _descriptor: ResourceDescriptor, ) -> Result<Box<dyn FileReader>, FilesystemError>
Construct an ID-only resource without accessing storage during replay.
fn restore_directory( &self, _descriptor: ResourceDescriptor, ) -> Result<Box<dyn DirectoryReader>, FilesystemError>
fn restore_writer( &self, _descriptor: ResourceDescriptor, ) -> Result<Box<dyn FileWriter>, FilesystemError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".