[−][src]Struct yy_boss::YyResourceHandler
Fields
dirty: bool
resources: HashMap<FilesystemPath, YyResourceData<T>>
dirty_resources: Vec<FilesystemPath>
Implementations
impl<T: YyResource> YyResourceHandler<T>
[src]
pub fn new() -> Self
[src]
pub fn shared_data(&self) -> Option<&T::SharedData>
[src]
pub fn load_data(&mut self, project_directory: &Path) -> AnyResult<()>
[src]
Initialize Shared Data and Associated Data. For a sprite,
for example, this will include loading all pngs
and loading
the Shared Import Data.
pub fn force_load_data(&mut self, project_directory: &Path) -> AnyResult<()>
[src]
This loads or reloads data for each Associated Data and the Shared Data. In other words,
this will OVERWRITE the current data for any resource which has a Some(_)
Associated Data.
If you just want to just load Associated Data for any Resources with None
, use load_data
.
pub fn add_new(
&mut self,
value: T,
associated_data: T::AssociatedData
) -> Option<YyResourceData<T>>
[src]
&mut self,
value: T,
associated_data: T::AssociatedData
) -> Option<YyResourceData<T>>
pub fn overwrite(
&mut self,
value: T,
associated_data: T::AssociatedData
) -> AnyResult<()>
[src]
&mut self,
value: T,
associated_data: T::AssociatedData
) -> AnyResult<()>
Returns an error if the given resource did not exist.
pub fn add_new_startup(
&mut self,
value: T,
associated_data: Option<T::AssociatedData>
) -> Option<YyResourceData<T>>
[src]
&mut self,
value: T,
associated_data: Option<T::AssociatedData>
) -> Option<YyResourceData<T>>
This is the same as add_new
but it doesn't dirty the resource. It is used
for startup operations, where we're loading in assets from disk.
pub fn serialize(&mut self, project_path: &Path) -> AnyResult<()>
[src]
Trait Implementations
impl<T: Debug + YyResource> Debug for YyResourceHandler<T> where
T::SharedData: Debug,
[src]
T::SharedData: Debug,
impl<T: Default + YyResource> Default for YyResourceHandler<T> where
T::SharedData: Default,
[src]
T::SharedData: Default,
fn default() -> YyResourceHandler<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for YyResourceHandler<T> where
T: RefUnwindSafe,
<T as YyResource>::AssociatedData: RefUnwindSafe,
<T as YyResource>::SharedData: RefUnwindSafe,
T: RefUnwindSafe,
<T as YyResource>::AssociatedData: RefUnwindSafe,
<T as YyResource>::SharedData: RefUnwindSafe,
impl<T> Send for YyResourceHandler<T> where
T: Send,
<T as YyResource>::AssociatedData: Send,
<T as YyResource>::SharedData: Send,
T: Send,
<T as YyResource>::AssociatedData: Send,
<T as YyResource>::SharedData: Send,
impl<T> Sync for YyResourceHandler<T> where
T: Sync,
<T as YyResource>::AssociatedData: Sync,
<T as YyResource>::SharedData: Sync,
T: Sync,
<T as YyResource>::AssociatedData: Sync,
<T as YyResource>::SharedData: Sync,
impl<T> Unpin for YyResourceHandler<T> where
T: Unpin,
<T as YyResource>::AssociatedData: Unpin,
<T as YyResource>::SharedData: Unpin,
T: Unpin,
<T as YyResource>::AssociatedData: Unpin,
<T as YyResource>::SharedData: Unpin,
impl<T> UnwindSafe for YyResourceHandler<T> where
T: UnwindSafe,
<T as YyResource>::AssociatedData: UnwindSafe,
<T as YyResource>::SharedData: UnwindSafe,
T: UnwindSafe,
<T as YyResource>::AssociatedData: UnwindSafe,
<T as YyResource>::SharedData: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,