pub struct SubAsset {
pub file_id: i64,
pub class_id: u32,
pub name: Box<str>,
}Expand description
One sub-object inside an asset that has its own fileID.
Sprite-atlas entries, multi-clip animations, sprite-sheet sub-sprites,
prefab-embedded AnimationClip docs. Per-entry list is sorted by
file_id for binary-search lookups.
class_id is the Unity native classID of the sub-doc (74 for
AnimationClip, 213 for Sprite, etc.). Stored explicitly because
prefab-embedded sub-asset fileIDs are hashed (negative or non-multiple-
of-100000) and a file_id / 100_000 heuristic collapses them to
ScriptableObject — the asset DB needs the real class for the
strict-typed-field elision rule consumers apply downstream.
name is Box<str> rather than String — strings here are immutable
once decoded; dropping the capacity field saves 8 bytes per entry.
Fields§
§file_id: i64§class_id: u32§name: Box<str>Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for SubAsset
impl<'__de, __Context> BorrowDecode<'__de, __Context> for SubAsset
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Auto Trait Implementations§
impl Freeze for SubAsset
impl RefUnwindSafe for SubAsset
impl Send for SubAsset
impl Sync for SubAsset
impl Unpin for SubAsset
impl UnsafeUnpin for SubAsset
impl UnwindSafe for SubAsset
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