Struct keeshond_datapack::DataHandle [−][src]
pub struct DataHandle<T: DataObject + 'static> { /* fields omitted */ }
Expand description
A path to a data resource, resolvable to a cached DataId.
Implementations
Creates a new DataHandle with the given resource path. The data ID will be unresolved. You will need to call resolve() for the data ID to point to a valid resource.
Changes the resource path. The data ID will reset to be unresolved. You will need to call resolve() for the data ID to point to a valid resource.
Returns the data ID. You will need to call resolve() beforehand for the data ID to point to a valid resource.
Returns true if the path has been resolved via a call to resolve().
Resolves the data ID using the given DataStore. Returns the resolved data ID, which is cached inside the object. If load_error is Fatal, this function will panic if the load fails. Otherwise it will simply return a null data ID.
Returns a reference to data object in the store, if it exists. If the data object is not resolved, then resolve() will be called, and then the data object reference returned, if available.
Returns a mutable reference to data object in the store, if it exists. If the data object is not resolved, then resolve() will be called, and then the data object reference returned, if available.
Returns a reference to data object in the store, if it exists. If the data object is not resolved, returns None instead of attempting to resolve.
pub fn get_mut_if_resolved<'a, 'b: 'a>(
&self,
data_res: &'b mut DataStore<T>
) -> Option<&'a mut T>
pub fn get_mut_if_resolved<'a, 'b: 'a>(
&self,
data_res: &'b mut DataStore<T>
) -> Option<&'a mut T>
Returns a mutable reference to data object in the store, if it exists. If the data object is not resolved, returns None instead of attempting to resolve.
Resolves the data ID using the given DataStore. Returns the resolved data ID, which is cached inside the object. If the data is not yet loaded, returns a null ID.
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for DataHandle<T>
impl<T> Send for DataHandle<T> where
T: Send,
impl<T> !Sync for DataHandle<T>
impl<T> Unpin for DataHandle<T> where
T: Unpin,
impl<T> UnwindSafe for DataHandle<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more