pub trait AssetIo: 'static + Downcast + Send + Sync {
fn load_path(
&'a self,
path: &'a Path
) -> Pin<Box<dyn Future<Output = Result<Vec<u8, Global>, AssetIoError>> + Send + 'a, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
;
fn read_directory(
&self,
path: &Path
) -> Result<Box<dyn Iterator<Item = PathBuf> + 'static, Global>, AssetIoError>;
fn is_directory(&self, path: &Path) -> bool;
fn watch_path_for_changes(&self, path: &Path) -> Result<(), AssetIoError>;
fn watch_for_changes(&self) -> Result<(), AssetIoError>;
}
Expand description
Handles load requests from an AssetServer
Required methods
fn load_path(
&'a self,
path: &'a Path
) -> Pin<Box<dyn Future<Output = Result<Vec<u8, Global>, AssetIoError>> + Send + 'a, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
fn read_directory(
&self,
path: &Path
) -> Result<Box<dyn Iterator<Item = PathBuf> + 'static, Global>, AssetIoError>
fn is_directory(&self, path: &Path) -> bool
fn watch_path_for_changes(&self, path: &Path) -> Result<(), AssetIoError>
fn watch_for_changes(&self) -> Result<(), AssetIoError>
Implementations
impl dyn AssetIo + 'static
impl dyn AssetIo + 'static
pub fn is<__T>(&self) -> bool where
__T: AssetIo,
pub fn is<__T>(&self) -> bool where
__T: AssetIo,
Returns true if the trait object wraps an object of type __T
.
pub fn downcast<__T>(
self: Box<dyn AssetIo + 'static, Global>
) -> Result<Box<__T, Global>, Box<dyn AssetIo + 'static, Global>> where
__T: AssetIo,
pub fn downcast<__T>(
self: Box<dyn AssetIo + 'static, Global>
) -> Result<Box<__T, Global>, Box<dyn AssetIo + 'static, Global>> where
__T: AssetIo,
Returns a boxed object from a boxed trait object if the underlying object is of type
__T
. Returns the original boxed trait if it isn’t.
pub fn downcast_rc<__T>(
self: Rc<dyn AssetIo + 'static>
) -> Result<Rc<__T>, Rc<dyn AssetIo + 'static>> where
__T: AssetIo,
pub fn downcast_rc<__T>(
self: Rc<dyn AssetIo + 'static>
) -> Result<Rc<__T>, Rc<dyn AssetIo + 'static>> where
__T: AssetIo,
Returns an Rc
-ed object from an Rc
-ed trait object if the underlying object is of
type __T
. Returns the original Rc
-ed trait if it isn’t.
pub fn downcast_ref<__T>(&self) -> Option<&__T> where
__T: AssetIo,
pub fn downcast_ref<__T>(&self) -> Option<&__T> where
__T: AssetIo,
Returns a reference to the object within the trait object if it is of type __T
, or
None
if it isn’t.
pub fn downcast_mut<__T>(&mut self) -> Option<&mut __T> where
__T: AssetIo,
pub fn downcast_mut<__T>(&mut self) -> Option<&mut __T> where
__T: AssetIo,
Returns a mutable reference to the object within the trait object if it is of type
__T
, or None
if it isn’t.