Skip to main content

AssetRegistry

Struct AssetRegistry 

Source
pub struct AssetRegistry { /* private fields */ }
Expand description

Static mesh/material registry. IDs are typed by separate arenas and generations. Geometry is immutable; deleting a registry entry does not invalidate already prepared frames.

Implementations§

Source§

impl AssetRegistry

Source

pub fn new(limits: AssetLimits) -> Result<Self, RenderError>

Initialize explicit per-registry limits; no file/network access or GPU allocation.

Source

pub fn managed_bytes(&self) -> u64

Accounted CPU payload, including prepared frames and retired shared assets.

Source

pub fn register_mesh( &mut self, vertices: Vec<MeshVertex>, indices: Vec<u32>, ) -> Result<ResourceId, RenderError>

Retain validated static triangles. Both Vec capacities are checked/accounted, not just length.

Source

pub fn register_material( &mut self, color: [f32; 4], ) -> Result<ResourceId, RenderError>

Register finite linear RGBA in 0..1; no implicit clamping or textures in this profile.

Source

pub fn remove_mesh(&mut self, id: ResourceId) -> Result<(), RenderError>

Remove registration; payload reservation remains until its last prepared owner drops.

Source

pub fn remove_material(&mut self, id: ResourceId) -> Result<(), RenderError>

Remove material registration without invalidating already prepared frames.

Source

pub fn prepare( &self, snapshot: SceneSnapshot, ) -> Result<PreparedScene, RenderError>

Resolve every identity/selection before preparation. Static assets accept animation/morph 0 only. Consumes snapshot admission on success and releases it on controlled failure.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.