pub struct ResourceStore(/* private fields */);Expand description
Explicit project resource store and logical allowance; clones share identity and accounting. Each new Assets owner starts isolated unless with_store supplies a shared store. Decoded Arc values can outlive all owners/handles and are not then store-accounted.
It holds decoded resources that are loaded on demand, unlike the compute caches
(crate::SceneCache, crate::RenderCache) that retain recomputable values.
Implementations§
Source§impl ResourceStore
impl ResourceStore
Sourcepub fn with_limits(limits: ResourceLimits) -> Result<Self>
pub fn with_limits(limits: ResourceLimits) -> Result<Self>
Uses a positive payload allowance and 1..=4096 cached entries.
Sourcepub fn max_entries(&self) -> usize
pub fn max_entries(&self) -> usize
Configured cached-entry allowance.
Sourcepub fn retained_bytes(&self) -> usize
pub fn retained_bytes(&self) -> usize
Logical payload retained by this project, not process RSS.
Sourcepub fn same_store(&self, other: &Self) -> bool
pub fn same_store(&self, other: &Self) -> bool
Whether two owners charge the same project store.
Trait Implementations§
Source§impl Clone for ResourceStore
impl Clone for ResourceStore
Auto Trait Implementations§
impl Forget for ResourceStore
impl Freeze for ResourceStore
impl Move for ResourceStore
impl RefUnwindSafe for ResourceStore
impl Send for ResourceStore
impl Sync for ResourceStore
impl Unpin for ResourceStore
impl UnsafeUnpin for ResourceStore
impl UnwindSafe for ResourceStore
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