Skip to main content

HeapResourceTable

Struct HeapResourceTable 

Source
pub struct HeapResourceTable<State>
where State: ResourceRowState,
{ /* private fields */ }
Expand description

Heap table for a std host: every active slot can hold the largest transfer the protocol allows (a sealed MAX_EFFICIENT_SIZE stream), and retired slot buffers are kept for reuse by later transfers.

Trait Implementations§

Source§

impl<State> Debug for HeapResourceTable<State>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<State> Default for HeapResourceTable<State>

Source§

fn default() -> HeapResourceTable<State>

Returns the “default value” for a type. Read more
Source§

impl<State> ResourceTable<State> for HeapResourceTable<State>
where State: ResourceRowState + Default,

Source§

fn capacity(&self) -> usize

Source§

fn transfer_capacity(&self) -> usize

Source§

fn part_capacity(&self) -> usize

Source§

fn len(&self) -> usize

Source§

fn hashes(&self) -> &[ResourceHash]

Source§

fn timeout_ats(&self) -> &[Option<InstantMillis>]

Source§

fn states(&self) -> &[State]

Source§

fn set_hash(&mut self, index: usize, hash: ResourceHash)

Source§

fn set_timeout_at(&mut self, index: usize, timeout_at: Option<InstantMillis>)

Source§

fn state_mut(&mut self, index: usize) -> &mut State

Source§

fn transfer(&self, index: usize) -> &[u8]

Source§

fn part_names(&self, index: usize) -> &[[u8; 4]]

Source§

fn part_flags(&self, index: usize) -> &[bool]

Source§

fn streamed_open( &self, index: usize, ) -> &<State as ResourceRowState>::StreamedOpenSlot

Source§

fn buffers_mut(&mut self, index: usize) -> ResourceBuffers<'_>

Source§

fn transfer_and_streamed_open_mut( &mut self, index: usize, ) -> (&mut [u8], &mut <State as ResourceRowState>::StreamedOpenSlot)

Source§

fn push( &mut self, link_id: LinkId, hash: ResourceHash, state: State, ) -> Result<usize, ResourceTablePushError>

Source§

fn swap_remove(&mut self, index: usize)

Source§

fn is_empty(&self) -> bool

Auto Trait Implementations§

§

impl<State> Freeze for HeapResourceTable<State>

§

impl<State> RefUnwindSafe for HeapResourceTable<State>

§

impl<State> Send for HeapResourceTable<State>
where State: Send, <State as ResourceRowState>::StreamedOpenSlot: Send,

§

impl<State> Sync for HeapResourceTable<State>
where State: Sync, <State as ResourceRowState>::StreamedOpenSlot: Sync,

§

impl<State> Unpin for HeapResourceTable<State>
where State: Unpin, <State as ResourceRowState>::StreamedOpenSlot: Unpin,

§

impl<State> UnsafeUnpin for HeapResourceTable<State>

§

impl<State> UnwindSafe for HeapResourceTable<State>

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.