pub struct Hot<T: AssetKind> { /* private fields */ }Expand description
An asset of kind T that decodes again when a file it read changes
(the module docs).
Implementations§
Source§impl<T: AssetKind> Hot<T>
impl<T: AssetKind> Hot<T>
Sourcepub fn load(
formats: &Arc<Formats>,
bundle: &Bundle,
id: &str,
) -> Result<Self, Vec<ContentError>>
pub fn load( formats: &Arc<Formats>, bundle: &Bundle, id: &str, ) -> Result<Self, Vec<ContentError>>
The asset id of bundle, read with formats as
Formats::load reads it.
§Errors
Every problem Formats::load found.
Sourcepub fn reads(&self) -> impl Iterator<Item = &str>
pub fn reads(&self) -> impl Iterator<Item = &str>
The files its decode asked for, sorted: a change to any of them reloads it.
Sourcepub fn refresh(&mut self, changed: &[String]) -> Reload
pub fn refresh(&mut self, changed: &[String]) -> Reload
Decodes it again if a file it read is among changed (paths in
the bundle, as Bundle::bytes takes them). A value that fails
keeps the old one, and tries again the next time one of its
files changes.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Hot<T>
impl<T> !UnwindSafe for Hot<T>
impl<T> Freeze for Hot<T>where
T: Freeze,
impl<T> Send for Hot<T>where
T: Send,
impl<T> Sync for Hot<T>where
T: Sync,
impl<T> Unpin for Hot<T>where
T: Unpin,
impl<T> UnsafeUnpin for Hot<T>where
T: UnsafeUnpin,
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