pub struct FixedResourceTable<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize>where
State: ResourceRowState,{ /* private fields */ }Expand description
Inline table for a no_std target: every byte the slots can hold lives in the struct, sized where the storage recipe is assembled. MAX_PARTS must cover TRANSFER_BYTES at the broadcast-MTU sdu; the constructor proves it at compile time.
Trait Implementations§
Source§impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> Debug for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> Debug for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>
Source§impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> Default for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>where
State: ResourceRowState + Default,
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> Default for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>where
State: ResourceRowState + Default,
Source§fn default() -> FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>
fn default() -> FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>
Returns the “default value” for a type. Read more
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,
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,
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)
fn is_empty(&self) -> bool
Auto Trait Implementations§
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> Freeze for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> RefUnwindSafe for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> Send for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> Sync for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> Unpin for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> UnsafeUnpin for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> UnwindSafe for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>
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