pub struct NoPayloads;Expand description
A payload store holding nothing: every read errors and every release is a
no-op. What a World built without a blob runs on –
unit tests, and worlds assembled entirely from runtime-only components.
Trait Implementations§
Source§impl PayloadStore for NoPayloads
impl PayloadStore for NoPayloads
Source§fn read(&mut self, _locator: &PayloadLocator) -> Result<&[u8], CnResult>
fn read(&mut self, _locator: &PayloadLocator) -> Result<&[u8], CnResult>
Read the bytes a locator points at.
&mut self because a disk-backed
store may load an overflow section lazily on first access. Errors when
the payload was released, the locator is out of range, or a lazy load
fails.Source§fn release(&mut self, _blob_index: u32)
fn release(&mut self, _blob_index: u32)
Release an entire blob’s in-memory payload once every system that needs
it has finished (e.g. after GPU upload). A store with nothing resident
for
blob_index treats this as a no-op.Source§fn disk_backed(&self) -> bool
fn disk_backed(&self) -> bool
Whether the payloads are backed by files still on disk, so a released
payload can be re-read on demand rather than kept RAM-resident.
Source§fn release_all_resident(&mut self) -> usize
fn release_all_resident(&mut self) -> usize
Release every resident section at once, returning the bytes freed.
World::start calls this after init: systems read compiled payloads
only while initing and cache what they keep, so nothing consults the
store again. A store with nothing resident frees nothing.Auto Trait Implementations§
impl Freeze for NoPayloads
impl RefUnwindSafe for NoPayloads
impl Send for NoPayloads
impl Sync for NoPayloads
impl Unpin for NoPayloads
impl UnsafeUnpin for NoPayloads
impl UnwindSafe for NoPayloads
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