pub trait VfsExt<'vfs>: Vfs<'vfs> {
// Provided methods
fn read_typed_pinned<T: ReadFrom<'vfs, Self>>(
self: Pin<&'vfs Self>,
path: impl AsRef<Self::Path>,
) -> VfsResult<T, Self> { ... }
fn read_typed<T: ReadFrom<'vfs, Self>>(
&'vfs self,
path: impl AsRef<Self::Path>,
) -> VfsResult<T, Self>
where Self: Unpin { ... }
}Expand description
Provided Methods§
Sourcefn read_typed_pinned<T: ReadFrom<'vfs, Self>>(
self: Pin<&'vfs Self>,
path: impl AsRef<Self::Path>,
) -> VfsResult<T, Self>
fn read_typed_pinned<T: ReadFrom<'vfs, Self>>( self: Pin<&'vfs Self>, path: impl AsRef<Self::Path>, ) -> VfsResult<T, Self>
Reads a file / directory at the specified path, and parses it into the specified type using its
ReadFrom implementation.
This method takes self as a pinned reference, to ensure that the Vfs implementation
is not moved while the read operation is in progress, or if the type T being read stores
a reference to the Vfs instance (e.g., via [DeferredRead][crate::deferred_read::DeferredRead]).
Sourcefn read_typed<T: ReadFrom<'vfs, Self>>(
&'vfs self,
path: impl AsRef<Self::Path>,
) -> VfsResult<T, Self>where
Self: Unpin,
fn read_typed<T: ReadFrom<'vfs, Self>>(
&'vfs self,
path: impl AsRef<Self::Path>,
) -> VfsResult<T, Self>where
Self: Unpin,
Reads a file / directory at the specified path, and parses it into the specified type using its
ReadFrom implementation.
This method takes self as a regular reference, and pins it internally, calling
read_typed_pinned on the pinned reference.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.