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)
Source§fn admission_for_shape(
&self,
shape: ResourceBufferShape,
) -> ResourceTableAdmission
fn admission_for_shape( &self, shape: ResourceBufferShape, ) -> ResourceTableAdmission
Classify a validated row shape without reserving it. The pending-offer
scheduler uses this to distinguish burst pressure from an offer that
can never fit this storage recipe.
fn push( &mut self, link_id: LinkId, hash: ResourceHash, state: State, shape: ResourceBufferShape, ) -> Result<usize, ResourceTablePushError>
fn swap_remove(&mut self, index: usize)
fn active_buffer_bytes(&self) -> usize
fn buffer_memory_limit(&self) -> 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>where
[LinkId; SLOTS]: Freeze,
[ResourceHash; SLOTS]: Freeze,
[Option<InstantMillis>; SLOTS]: Freeze,
[State; SLOTS]: Freeze,
[[u8; TRANSFER_BYTES]; SLOTS]: Freeze,
[[[u8; 4]; MAX_PARTS]; SLOTS]: Freeze,
[[bool; MAX_PARTS]; SLOTS]: Freeze,
[<State as ResourceRowState>::StreamedOpenSlot; SLOTS]: Freeze,
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> RefUnwindSafe for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>where
[LinkId; SLOTS]: RefUnwindSafe,
[ResourceHash; SLOTS]: RefUnwindSafe,
[Option<InstantMillis>; SLOTS]: RefUnwindSafe,
[State; SLOTS]: RefUnwindSafe,
[[u8; TRANSFER_BYTES]; SLOTS]: RefUnwindSafe,
[[[u8; 4]; MAX_PARTS]; SLOTS]: RefUnwindSafe,
[[bool; MAX_PARTS]; SLOTS]: RefUnwindSafe,
[<State as ResourceRowState>::StreamedOpenSlot; SLOTS]: RefUnwindSafe,
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> Send for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>where
[LinkId; SLOTS]: Send,
[ResourceHash; SLOTS]: Send,
[Option<InstantMillis>; SLOTS]: Send,
[State; SLOTS]: Send,
[[u8; TRANSFER_BYTES]; SLOTS]: Send,
[[[u8; 4]; MAX_PARTS]; SLOTS]: Send,
[[bool; MAX_PARTS]; SLOTS]: Send,
[<State as ResourceRowState>::StreamedOpenSlot; SLOTS]: Send,
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> Sync for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>where
[LinkId; SLOTS]: Sync,
[ResourceHash; SLOTS]: Sync,
[Option<InstantMillis>; SLOTS]: Sync,
[State; SLOTS]: Sync,
[[u8; TRANSFER_BYTES]; SLOTS]: Sync,
[[[u8; 4]; MAX_PARTS]; SLOTS]: Sync,
[[bool; MAX_PARTS]; SLOTS]: Sync,
[<State as ResourceRowState>::StreamedOpenSlot; SLOTS]: Sync,
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> Unpin for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>where
[LinkId; SLOTS]: Unpin,
[ResourceHash; SLOTS]: Unpin,
[Option<InstantMillis>; SLOTS]: Unpin,
[State; SLOTS]: Unpin,
[[u8; TRANSFER_BYTES]; SLOTS]: Unpin,
[[[u8; 4]; MAX_PARTS]; SLOTS]: Unpin,
[[bool; MAX_PARTS]; SLOTS]: Unpin,
[<State as ResourceRowState>::StreamedOpenSlot; SLOTS]: Unpin,
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> UnsafeUnpin for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>where
[LinkId; SLOTS]: UnsafeUnpin,
[ResourceHash; SLOTS]: UnsafeUnpin,
[Option<InstantMillis>; SLOTS]: UnsafeUnpin,
[State; SLOTS]: UnsafeUnpin,
[[u8; TRANSFER_BYTES]; SLOTS]: UnsafeUnpin,
[[[u8; 4]; MAX_PARTS]; SLOTS]: UnsafeUnpin,
[[bool; MAX_PARTS]; SLOTS]: UnsafeUnpin,
[<State as ResourceRowState>::StreamedOpenSlot; SLOTS]: UnsafeUnpin,
impl<State, const SLOTS: usize, const TRANSFER_BYTES: usize, const MAX_PARTS: usize> UnwindSafe for FixedResourceTable<State, SLOTS, TRANSFER_BYTES, MAX_PARTS>where
[LinkId; SLOTS]: UnwindSafe,
[ResourceHash; SLOTS]: UnwindSafe,
[Option<InstantMillis>; SLOTS]: UnwindSafe,
[State; SLOTS]: UnwindSafe,
[[u8; TRANSFER_BYTES]; SLOTS]: UnwindSafe,
[[[u8; 4]; MAX_PARTS]; SLOTS]: UnwindSafe,
[[bool; MAX_PARTS]; SLOTS]: UnwindSafe,
[<State as ResourceRowState>::StreamedOpenSlot; SLOTS]: UnwindSafe,
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