Skip to main content

Hot

Struct Hot 

Source
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>

Source

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.

Source

pub fn id(&self) -> &str

What it was asked for by.

Source

pub fn reads(&self) -> impl Iterator<Item = &str>

The files its decode asked for, sorted: a change to any of them reloads it.

Source

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§

Source§

impl<T: AssetKind + Debug> Debug for Hot<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: AssetKind> Deref for Hot<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.