Skip to main content

NoPayloads

Struct NoPayloads 

Source
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

Source§

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)

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

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

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§

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, !>

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.