ArrayCodec

Struct ArrayCodec 

Source
pub struct ArrayCodec<B, Item, C, const ITEM_BIT_SIZE: usize> { /* private fields */ }

Implementations§

Source§

impl<B, Item, C, const ITEM_BIT_SIZE: usize> ArrayCodec<B, Item, C, ITEM_BIT_SIZE>

Source

pub fn new(buffer: B) -> Self

Source§

impl<B: AsRef<[u8]>, Item: ReadBytes, C: ByteCodec, const ITEM_BIT_SIZE: usize> ArrayCodec<B, Item, C, ITEM_BIT_SIZE>

Source

pub fn get(&self, index: usize) -> Item

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn iter_raw(&self) -> impl Iterator<Item = Item> + '_

Source§

impl<B: AsMut<[u8]>, Item: WriteBytes, C: ByteCodec, const ITEM_BIT_SIZE: usize> ArrayCodec<B, Item, C, ITEM_BIT_SIZE>

Source

pub fn set(&mut self, index: usize, value: Item) -> &mut Self

Trait Implementations§

Source§

impl<B: AsMut<[u8]>, C> AsMut<[u8]> for ArrayCodec<B, u8, C, 8>

Source§

fn as_mut(&mut self) -> &mut [u8]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<B: AsRef<[u8]>, C> AsRef<[u8]> for ArrayCodec<B, u8, C, 8>

Source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.

Auto Trait Implementations§

§

impl<B, Item, C, const ITEM_BIT_SIZE: usize> Freeze for ArrayCodec<B, Item, C, ITEM_BIT_SIZE>
where B: Freeze,

§

impl<B, Item, C, const ITEM_BIT_SIZE: usize> RefUnwindSafe for ArrayCodec<B, Item, C, ITEM_BIT_SIZE>

§

impl<B, Item, C, const ITEM_BIT_SIZE: usize> Send for ArrayCodec<B, Item, C, ITEM_BIT_SIZE>
where B: Send, Item: Send, C: Send,

§

impl<B, Item, C, const ITEM_BIT_SIZE: usize> Sync for ArrayCodec<B, Item, C, ITEM_BIT_SIZE>
where B: Sync, Item: Sync, C: Sync,

§

impl<B, Item, C, const ITEM_BIT_SIZE: usize> Unpin for ArrayCodec<B, Item, C, ITEM_BIT_SIZE>
where B: Unpin, Item: Unpin, C: Unpin,

§

impl<B, Item, C, const ITEM_BIT_SIZE: usize> UnwindSafe for ArrayCodec<B, Item, C, ITEM_BIT_SIZE>
where B: UnwindSafe, Item: UnwindSafe, C: UnwindSafe,

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, U> IntoUnion<U> for T
where U: FromValue<T>,

Source§

fn into_union(self) -> U

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.