pub struct VirtualFileSystem { /* private fields */ }
Expand description
The runtime representation of the asset index (index.bin
).
The Virtual File System is a service that provides fast, in-memory access
to the metadata of all assets available in the packed data. It is the
primary source of truth for the AssetAgent
when it needs to make decisions
about loading assets.
Implementations§
Source§impl VirtualFileSystem
impl VirtualFileSystem
Sourcepub fn new(index_bytes: &[u8]) -> Result<Self, DecodeError>
pub fn new(index_bytes: &[u8]) -> Result<Self, DecodeError>
Creates a new VirtualFileSystem
by loading and parsing an index file from its raw bytes.
This function is the entry point for the runtime asset system. It takes the
binary data from index.bin
and builds the in-memory lookup table.
§Errors
Returns a DecodeError
if the byte slice is not a valid, bincode-encoded
list of AssetMetadata
.
Sourcepub fn get_metadata(&self, uuid: &AssetUUID) -> Option<&AssetMetadata>
pub fn get_metadata(&self, uuid: &AssetUUID) -> Option<&AssetMetadata>
Retrieves the metadata for a given asset UUID.
This is the primary query method used by the AssetAgent
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VirtualFileSystem
impl RefUnwindSafe for VirtualFileSystem
impl Send for VirtualFileSystem
impl Sync for VirtualFileSystem
impl Unpin for VirtualFileSystem
impl UnwindSafe for VirtualFileSystem
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