Struct yy_boss::YyResourceHandler[][src]

pub struct YyResourceHandler<T: YyResource> { /* fields omitted */ }

Implementations

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.

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.

Attempts to mark a resource for serialization, and returns if it was succesfully marked.

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.

Unloads a resource. This will free up some memory.

If the resource does not exist on this handler, an error will be returned.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.