[][src]Struct yy_boss::YyResourceHandler

pub struct YyResourceHandler<T: YyResource> {
    pub dirty: bool,
    pub resources: HashMap<FilesystemPath, YyResourceData<T>>,
    pub shared_data: Option<T::SharedData>,
    pub dirty_resources: Vec<FilesystemPath>,
}

Fields

dirty: boolresources: HashMap<FilesystemPath, YyResourceData<T>>shared_data: Option<T::SharedData>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]

pub fn overwrite(
    &mut self,
    value: T,
    associated_data: T::AssociatedData
) -> AnyResult<()>
[src]

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]

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]

impl<T: Default + YyResource> Default for YyResourceHandler<T> where
    T::SharedData: Default
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for YyResourceHandler<T> where
    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

impl<T> Sync for YyResourceHandler<T> where
    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

impl<T> UnwindSafe for YyResourceHandler<T> where
    T: UnwindSafe,
    <T as YyResource>::AssociatedData: UnwindSafe,
    <T as YyResource>::SharedData: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,