Skip to main content

ResourceTable

Trait ResourceTable 

Source
pub trait ResourceTable<State>
where State: ResourceRowState,
{
Show 20 methods // Required methods fn capacity(&self) -> usize; fn transfer_capacity(&self) -> usize; fn part_capacity(&self) -> usize; fn len(&self) -> usize; fn link_ids(&self) -> &[LinkId]; fn hashes(&self) -> &[ResourceHash]; fn timeout_ats(&self) -> &[Option<InstantMillis>]; fn states(&self) -> &[State]; fn set_hash(&mut self, index: usize, hash: ResourceHash); fn set_timeout_at( &mut self, index: usize, timeout_at: Option<InstantMillis>, ); fn state_mut(&mut self, index: usize) -> &mut State; fn transfer(&self, index: usize) -> &[u8] ; fn part_names(&self, index: usize) -> &[[u8; 4]]; fn part_flags(&self, index: usize) -> &[bool]; fn streamed_open( &self, index: usize, ) -> &<State as ResourceRowState>::StreamedOpenSlot; fn buffers_mut(&mut self, index: usize) -> ResourceBuffers<'_>; fn transfer_and_streamed_open_mut( &mut self, index: usize, ) -> (&mut [u8], &mut <State as ResourceRowState>::StreamedOpenSlot); fn push( &mut self, link_id: LinkId, hash: ResourceHash, state: State, ) -> Result<usize, ResourceTablePushError>; fn swap_remove(&mut self, index: usize); // Provided method fn is_empty(&self) -> bool { ... }
}

Required Methods§

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)

Provided Methods§

Source

fn is_empty(&self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize, A> ResourceTable<State> for FixedHeapResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS, A>
where State: ResourceRowState + Default, A: Allocator,

Source§

impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> ResourceTable<State> for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>
where State: ResourceRowState + Default,

Source§

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