[−][src]Struct yy_boss::YyResourceHandler
Implementations
impl<T: YyResource> YyResourceHandler<T>
[src]
pub fn get(&self, name: &str) -> Option<&YyResourceData<T>>
[src]
Returns an immutable reference to a resource's data, if it exists.
Since associated data is lazily loaded, and be unloaded at any time,
there may not be any associated data returned. You can request that data to be
loaded using load_resource_associated_data
.
pub unsafe fn get_mut(&mut self, name: &str) -> Option<&mut YyResourceData<T>>
[src]
Returns an mutable reference to a resource's data, if it exists.
Since associated data is lazily loaded, and be unloaded at any time,
there may not be any associated data returned. You can request that data to be
loaded using load_resource_associated_data
.
Safety
This function is VERY UNSAFE, but not in a memory sense. The entire purpose of this library is, in effect, to shield the user from making changes to the Yyp database which require side effects. How could a user know which effects to use and what to not use? They absolutely cannot. Unless you are very certain that the change you are making will not impact anything outside that file, do not use this function.
Additionally, be aware that mutating data does not guarentee serialization: please use force_serialize
.
pub fn force_serialize(
&mut self,
name: &str
) -> Result<(), YyResourceHandlerError>
[src]
&mut self,
name: &str
) -> Result<(), YyResourceHandlerError>
Attempts to mark a resource for serialization, and returns if it was succesfully marked.
pub fn load_resource_associated_data(
&mut self,
resource_name: &str,
root: &Path,
tcu: &TrailingCommaUtility
) -> Result<&T::AssociatedData, YyResourceHandlerError>
[src]
&mut self,
resource_name: &str,
root: &Path,
tcu: &TrailingCommaUtility
) -> Result<&T::AssociatedData, YyResourceHandlerError>
Loads in the associated data of a given resource name, if that resource exists and is managed.
If that resource already has some associated data, it will be discarded, and the new data will be loaded. If the resource does not exist or is not of the type that this manager handles, an error will be returned.
pub fn unload_resource_associated_data(
&mut self,
resource_name: &str
) -> Result<(), YyResourceHandlerError>
[src]
&mut self,
resource_name: &str
) -> Result<(), YyResourceHandlerError>
Unloads a resource. This will free up some memory.
If the resource does not exist on this handler, an error will be returned.
impl YyResourceHandler<Object>
[src]
pub fn add_event(&mut self, identifier: &str, event_type: EventType) -> bool
[src]
pub fn remove_event(&mut self, identifier: &str, event_type: EventType) -> bool
[src]
Trait Implementations
impl<T: Debug + YyResource> Debug for YyResourceHandler<T>
[src]
impl<T: YyResource> Default for YyResourceHandler<T>
[src]
impl<'a, T: YyResource> IntoIterator for &'a YyResourceHandler<T>
[src]
type Item = &'a YyResourceData<T>
The type of the elements being iterated over.
type IntoIter = Values<'a, String, YyResourceData<T>>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> Self::IntoIter
[src]
impl<T: PartialEq + YyResource> PartialEq<YyResourceHandler<T>> for YyResourceHandler<T>
[src]
pub fn eq(&self, other: &YyResourceHandler<T>) -> bool
[src]
pub fn ne(&self, other: &YyResourceHandler<T>) -> bool
[src]
impl<T: YyResource> StructuralPartialEq for YyResourceHandler<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for YyResourceHandler<T> where
T: RefUnwindSafe,
<T as YyResource>::AssociatedData: RefUnwindSafe,
[src]
T: RefUnwindSafe,
<T as YyResource>::AssociatedData: RefUnwindSafe,
impl<T> Send for YyResourceHandler<T> where
T: Send,
<T as YyResource>::AssociatedData: Send,
[src]
T: Send,
<T as YyResource>::AssociatedData: Send,
impl<T> Sync for YyResourceHandler<T> where
T: Sync,
<T as YyResource>::AssociatedData: Sync,
[src]
T: Sync,
<T as YyResource>::AssociatedData: Sync,
impl<T> Unpin for YyResourceHandler<T> where
T: Unpin,
<T as YyResource>::AssociatedData: Unpin,
[src]
T: Unpin,
<T as YyResource>::AssociatedData: Unpin,
impl<T> UnwindSafe for YyResourceHandler<T> where
T: UnwindSafe,
<T as YyResource>::AssociatedData: UnwindSafe,
[src]
T: UnwindSafe,
<T as YyResource>::AssociatedData: 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,
pub 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, 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.
pub 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.
pub 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>,