Skip to main content

SceneResidency

Struct SceneResidency 

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

Per-scene residency pins, one refcount per resource and channel.

Implementations§

Source§

impl SceneResidency

Source

pub fn new(scenes: Vec<(AssetId, Vec<Member>)>) -> Self

Build from each scene’s exclusively-owned members. Every scene starts unpinned with nothing resident; the driver blocks every owned member (all_members) at setup, then the first sync_pins unblocks the pinned scenes’ members.

Source

pub fn is_empty(&self) -> bool

Whether nothing is pinned.

Source

pub fn all_members(&self) -> impl Iterator<Item = Member> + '_

Every scene-owned member, for the driver’s setup pass: all owned members start blocked, matching every scene starting unpinned.

Source

pub fn sync_pins(&mut self, pinned: &[AssetId]) -> PinChanges

Establish the pin set: exactly the scenes in pinned are pinned after this call. Returns the members whose blocked state must change on the stream planners (a no-op sync returns empty changes).

Source

pub fn note_resident(&mut self, member: Member, resident: bool)

Record a member’s residency transition (a completed upload or an applied eviction). Members owned by no scene are ignored.

Source

pub fn state(&self, scene: AssetId) -> Option<SceneLoadState>

The scene’s derived load state, or None for an unknown scene.

Source

pub fn progress(&self, scene: AssetId) -> Option<f32>

Fraction of the scene’s members resident (1.0 with no members), or None for an unknown scene.

Source

pub fn any_loading(&self) -> bool

Whether any pinned scene still has members loading.

Source

pub fn status(&self) -> Vec<(AssetId, SceneLoadState, f32)>

Every scene’s (id, state, progress), in declaration order.

Source

pub fn status_into(&self, out: &mut Vec<(AssetId, SceneLoadState, f32)>)

status, written into out (cleared first) so a per-frame poll reuses its buffer.

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, <T as TryFrom<U>>::Error>

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.