pub struct NativeFilesystem { /* private fields */ }Expand description
A filesystem implementation that reads from the native OS filesystem.
This implementation provides async access to files on the local filesystem, with all asset paths resolved relative to a configured root directory. Currently uses blocking I/O operations wrapped in async functions.
Implementations§
Trait Implementations§
Source§impl Filesystem for NativeFilesystem
impl Filesystem for NativeFilesystem
Source§fn read_bytes<'life0, 'life1, 'async_trait>(
&'life0 self,
asset_path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, FilesystemError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_bytes<'life0, 'life1, 'async_trait>(
&'life0 self,
asset_path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, FilesystemError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Asynchronously reads the contents of an asset file as raw bytes. Read more
Source§fn write_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
asset_path: &'life1 str,
data: &'life2 [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_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
asset_path: &'life1 str,
data: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), FilesystemError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Asynchronously writes raw bytes to an asset file. Read more
Auto Trait Implementations§
impl Freeze for NativeFilesystem
impl RefUnwindSafe for NativeFilesystem
impl Send for NativeFilesystem
impl Sync for NativeFilesystem
impl Unpin for NativeFilesystem
impl UnsafeUnpin for NativeFilesystem
impl UnwindSafe for NativeFilesystem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.