pub struct NamedAsset<T> {
pub name: ArrayString<ASSET_NAME_LENGTH>,
pub asset: T,
}
Expand description
A unique name and a T
. Used in
ResourceDatabase
and when creating the db
file.
Implements equality and comparison operators purely based on the name, as assets with a specific name should be unique within a resource database.
Fields§
§name: ArrayString<ASSET_NAME_LENGTH>
The unique name of the asset.
asset: T
The asset itself.
Trait Implementations§
Source§impl<T: Debug> Debug for NamedAsset<T>
impl<T: Debug> Debug for NamedAsset<T>
Source§impl<D: Deserialize> Deserialize for NamedAsset<D>
impl<D: Deserialize> Deserialize for NamedAsset<D>
Source§const SERIALIZED_SIZE: usize
const SERIALIZED_SIZE: usize
The length of the buffer passed into
Deserialize::deserialize
.Source§fn deserialize(src: &[u8]) -> Self
fn deserialize(src: &[u8]) -> Self
Deserializes the byte buffer into the struct. The length of
src
must
match the same type’s Deserialize::SERIALIZED_SIZE
constant.Source§impl<T> Ord for NamedAsset<T>
impl<T> Ord for NamedAsset<T>
Source§impl<T> PartialEq for NamedAsset<T>
impl<T> PartialEq for NamedAsset<T>
Source§impl<T> PartialOrd for NamedAsset<T>
impl<T> PartialOrd for NamedAsset<T>
Source§impl<S: Serialize> Serialize for NamedAsset<S>
impl<S: Serialize> Serialize for NamedAsset<S>
Source§const SERIALIZED_SIZE: usize
const SERIALIZED_SIZE: usize
The length of the buffer passed into
Serialize::serialize
.Source§fn serialize(&self, dst: &mut [u8])
fn serialize(&self, dst: &mut [u8])
Serializes the struct into the byte buffer. The length of
dst
must
match the same type’s Serialize::SERIALIZED_SIZE
constant.impl<T> Eq for NamedAsset<T>
Auto Trait Implementations§
impl<T> Freeze for NamedAsset<T>where
T: Freeze,
impl<T> RefUnwindSafe for NamedAsset<T>where
T: RefUnwindSafe,
impl<T> Send for NamedAsset<T>where
T: Send,
impl<T> Sync for NamedAsset<T>where
T: Sync,
impl<T> Unpin for NamedAsset<T>where
T: Unpin,
impl<T> UnwindSafe for NamedAsset<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more