pub trait ConformanceFactory: Send + Sync {
// Required methods
fn fresh<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Box<dyn FileSystem>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn workspace<'life0, 'life1, 'async_trait>(
&'life0 self,
fs: &'life1 dyn FileSystem,
) -> Pin<Box<dyn Future<Output = WorkspaceId> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Constructs fresh, isolated backend instances and workspaces for one conformance case.
Workspace lifecycle (creating/naming a workspace) is backend-specific and
intentionally not part of the canonical FileSystem contract, so it
cannot be expressed generically over dyn FileSystem. Each conformance
case instead calls fresh to obtain a new
backend and immediately calls
workspace on that same instance before
calling fresh again for the next case; implementations may rely on
this fresh-then-workspace pairing happening without interleaving (for
example, by tracking the most recently created workspace in interior
state rather than deriving it from the fs argument’s identity).
Required Methods§
Sourcefn fresh<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Box<dyn FileSystem>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fresh<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Box<dyn FileSystem>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a new, empty backend instance.
Sourcefn workspace<'life0, 'life1, 'async_trait>(
&'life0 self,
fs: &'life1 dyn FileSystem,
) -> Pin<Box<dyn Future<Output = WorkspaceId> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn workspace<'life0, 'life1, 'async_trait>(
&'life0 self,
fs: &'life1 dyn FileSystem,
) -> Pin<Box<dyn Future<Output = WorkspaceId> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns a workspace to use on the backend most recently returned by
fresh.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".