pub struct SceneResidency { /* private fields */ }Expand description
Per-scene residency pins, one refcount per resource and channel.
Implementations§
Source§impl SceneResidency
impl SceneResidency
Sourcepub fn new(scenes: Vec<(AssetId, Vec<Member>)>) -> Self
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.
Sourcepub fn all_members(&self) -> impl Iterator<Item = Member> + '_
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.
Sourcepub fn sync_pins(&mut self, pinned: &[AssetId]) -> PinChanges
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).
Sourcepub fn note_resident(&mut self, member: Member, resident: bool)
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.
Sourcepub fn state(&self, scene: AssetId) -> Option<SceneLoadState>
pub fn state(&self, scene: AssetId) -> Option<SceneLoadState>
The scene’s derived load state, or None for an unknown scene.
Sourcepub fn progress(&self, scene: AssetId) -> Option<f32>
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.
Sourcepub fn any_loading(&self) -> bool
pub fn any_loading(&self) -> bool
Whether any pinned scene still has members loading.
Sourcepub fn status(&self) -> Vec<(AssetId, SceneLoadState, f32)>
pub fn status(&self) -> Vec<(AssetId, SceneLoadState, f32)>
Every scene’s (id, state, progress), in declaration order.
Sourcepub fn status_into(&self, out: &mut Vec<(AssetId, SceneLoadState, f32)>)
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.