Struct ResidencyGovernor
pub struct ResidencyGovernor<const MAX_SLOTS: usize> { /* private fields */ }Expand description
Fixed-capacity Tier-1 zero-heap governor for CPU and GPU VRAM residency.
Implementations§
§impl<const MAX_SLOTS: usize> ResidencyGovernor<MAX_SLOTS>
impl<const MAX_SLOTS: usize> ResidencyGovernor<MAX_SLOTS>
pub const fn new(caps: ResidencyPoolCaps) -> ResidencyGovernor<MAX_SLOTS>
pub const fn new(caps: ResidencyPoolCaps) -> ResidencyGovernor<MAX_SLOTS>
Creates a new governor with specified capacity caps and an empty slot array.
pub const fn caps(&self) -> ResidencyPoolCaps
pub const fn current_cpu_bytes(&self) -> u64
pub const fn current_gpu_vram_bytes(&self) -> u64
pub fn occupied_slots(&self) -> usize
pub fn pinned_slots(&self) -> usize
pub fn contains(&self, resource_hash: u64) -> bool
pub fn get_slot(&self, resource_hash: u64) -> Option<&ResidencySlot>
pub fn touch(&mut self, resource_hash: u64, current_tick: u64) -> bool
pub fn touch(&mut self, resource_hash: u64, current_tick: u64) -> bool
Touches a resident resource to refresh its LRU recency tick.
pub fn admit_or_evict_lru_zero_heap(
&mut self,
resource_hash: u64,
cpu_bytes: u64,
gpu_vram_bytes: u64,
pinned: bool,
current_tick: u64,
) -> Result<usize, ResidencyError>
pub fn admit_or_evict_lru_zero_heap( &mut self, resource_hash: u64, cpu_bytes: u64, gpu_vram_bytes: u64, pinned: bool, current_tick: u64, ) -> Result<usize, ResidencyError>
Tier-1 zero-heap admission with deterministic LRU eviction.
Fails closed with ResidencyBudgetExceeded if requested bytes exceed pool caps
or if existing pinned allocations leave insufficient headroom.
pub fn release_resource(
&mut self,
resource_hash: u64,
) -> Result<(), ResidencyError>
pub fn release_resource( &mut self, resource_hash: u64, ) -> Result<(), ResidencyError>
Releases a resident resource and returns its byte allocations to the pool.
pub fn pin_resource(
&mut self,
resource_hash: u64,
pinned: bool,
) -> Result<(), ResidencyError>
pub fn pin_resource( &mut self, resource_hash: u64, pinned: bool, ) -> Result<(), ResidencyError>
Sets or clears the pinned status for a resident resource.
pub fn cancel_pending_hydration(
&mut self,
resource_hash: u64,
) -> Result<(), ResidencyError>
pub fn cancel_pending_hydration( &mut self, resource_hash: u64, ) -> Result<(), ResidencyError>
Cancels a pending or in-flight hydration, releasing its slot immediately.
pub fn cancel_all_unpinned(&mut self) -> usize
pub fn cancel_all_unpinned(&mut self) -> usize
Evicts all unpinned resources (e.g. on stream abort or camera scene jump).
Trait Implementations§
§impl<const MAX_SLOTS: usize> Clone for ResidencyGovernor<MAX_SLOTS>
impl<const MAX_SLOTS: usize> Clone for ResidencyGovernor<MAX_SLOTS>
§fn clone(&self) -> ResidencyGovernor<MAX_SLOTS>
fn clone(&self) -> ResidencyGovernor<MAX_SLOTS>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<const MAX_SLOTS: usize> Copy for ResidencyGovernor<MAX_SLOTS>
Auto Trait Implementations§
impl<const MAX_SLOTS: usize> Freeze for ResidencyGovernor<MAX_SLOTS>
impl<const MAX_SLOTS: usize> RefUnwindSafe for ResidencyGovernor<MAX_SLOTS>
impl<const MAX_SLOTS: usize> Send for ResidencyGovernor<MAX_SLOTS>
impl<const MAX_SLOTS: usize> Sync for ResidencyGovernor<MAX_SLOTS>
impl<const MAX_SLOTS: usize> Unpin for ResidencyGovernor<MAX_SLOTS>
impl<const MAX_SLOTS: usize> UnsafeUnpin for ResidencyGovernor<MAX_SLOTS>
impl<const MAX_SLOTS: usize> UnwindSafe for ResidencyGovernor<MAX_SLOTS>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more