pub struct Grid<'a, E: IntegerElement, Bd: Bound, const N: usize> { /* private fields */ }Expand description
Any lookup codec, of any code width.
The 16-entry i4 grid is Grid<16>; a 65536-entry one is Grid<65536>. The
library carries no hardcoded table size, and no size is privileged.
The code space of an N-entry grid is Z/N, so an arbitrary u16 indexes
it modulo N. That is not a clamp and not an error path: it is what
“index into a table of N entries” means, and it is why this decode is
total on all 2^16 codes (C6).
Implementations§
Trait Implementations§
Source§impl<'a, E: Clone + IntegerElement, Bd: Clone + Bound, const N: usize> Clone for Grid<'a, E, Bd, N>
impl<'a, E: Clone + IntegerElement, Bd: Clone + Bound, const N: usize> Clone for Grid<'a, E, Bd, N>
Source§impl<E: IntegerElement, Bd: Bound, const N: usize> Codec<E, Bd> for Grid<'_, E, Bd, N>
impl<E: IntegerElement, Bd: Bound, const N: usize> Codec<E, Bd> for Grid<'_, E, Bd, N>
Source§const IS_FIXED_WIDTH: bool = true
const IS_FIXED_WIDTH: bool = true
Source§fn decode_len(&self, _code: Self::Code) -> usize
fn decode_len(&self, _code: Self::Code) -> usize
How many elements
code actually produces. Read moreimpl<'a, E: Copy + IntegerElement, Bd: Copy + Bound, const N: usize> Copy for Grid<'a, E, Bd, N>
Source§impl<'a, E: Debug + IntegerElement, Bd: Debug + Bound, const N: usize> Debug for Grid<'a, E, Bd, N>
impl<'a, E: Debug + IntegerElement, Bd: Debug + Bound, const N: usize> Debug for Grid<'a, E, Bd, N>
Source§impl<E: IntegerElement, Bd: Bound, const N: usize> Enumerable<E, Bd> for Grid<'_, E, Bd, N>
impl<E: IntegerElement, Bd: Bound, const N: usize> Enumerable<E, Bd> for Grid<'_, E, Bd, N>
Source§const CODE_SPACE: usize
const CODE_SPACE: usize
The number of distinct codes. Read more
Source§fn as_index_stream(codes: &[u16]) -> Option<IndexStream<'_>>
fn as_index_stream(codes: &[u16]) -> Option<IndexStream<'_>>
The stored code stream, read as the index stream it already is. Read more
Source§const SIGN_BIT_BOOK: bool = false
const SIGN_BIT_BOOK: bool = false
Whether the decoded book is the sign bit-decomposition:
CODE_SPACE is a power of two and book[c][t] == 2 * bit(c, t) - 1
for every code c and every t below its log. Read moreAuto Trait Implementations§
impl<'a, E, Bd, const N: usize> Freeze for Grid<'a, E, Bd, N>
impl<'a, E, Bd, const N: usize> RefUnwindSafe for Grid<'a, E, Bd, N>where
E: RefUnwindSafe,
Bd: RefUnwindSafe,
impl<'a, E, Bd, const N: usize> Send for Grid<'a, E, Bd, N>
impl<'a, E, Bd, const N: usize> Sync for Grid<'a, E, Bd, N>
impl<'a, E, Bd, const N: usize> Unpin for Grid<'a, E, Bd, N>
impl<'a, E, Bd, const N: usize> UnsafeUnpin for Grid<'a, E, Bd, N>
impl<'a, E, Bd, const N: usize> UnwindSafe for Grid<'a, E, Bd, N>where
E: RefUnwindSafe,
Bd: RefUnwindSafe,
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