pub trait BoxedFilesystem: Send + Sync {
// Required method
fn shutdown_boxed<'a>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
where Self: 'a;
}
Expand description
Helper trait for shutting down Box<dyn Filesystem>
objects.
Required Methods§
Sourcefn shutdown_boxed<'a>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>where
Self: 'a,
fn shutdown_boxed<'a>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>where
Self: 'a,
Filesystem::shutdown
takes the filesystem by value which doesn’t work for Box<&dyn Filesystem>
because the filesystem type isn’t known at compile time. Taking the filesystem
as Box<Self>
works and the type of the filesystem is now known so the
Filesystem::shutdown
method can be called.