Struct ArrayBitBucket

Source
pub struct ArrayBitBucket<const N: usize, T>(pub [T; N]);
Expand description

Array-based BitBucket implementation for large storage capacity.

Provides large BitBucket storage using multiple elements. This can be used to parse very deeply nested JSON.

Use the ArrayBitStack convenience wrapper to create this.

Tuple Fields§

§0: [T; N]

Trait Implementations§

Source§

impl<const N: usize, T> BitBucket for ArrayBitBucket<N, T>
where T: Shl<u8, Output = T> + Shr<u8, Output = T> + BitAnd<T, Output = T> + BitOr<Output = T> + PartialEq + Clone + From<u8> + Copy + Default,

Source§

fn push(&mut self, bit: bool)

Pushes a bit (true for 1, false for 0) onto the stack.
Source§

fn pop(&mut self) -> bool

Pops the top bit off the stack, returning it if the stack isn’t empty.
Source§

fn top(&self) -> bool

Returns the top bit without removing it.
Source§

impl<const N: usize, T: Debug> Debug for ArrayBitBucket<N, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize, T: Default + Copy> Default for ArrayBitBucket<N, T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<const N: usize, T> Freeze for ArrayBitBucket<N, T>
where T: Freeze,

§

impl<const N: usize, T> RefUnwindSafe for ArrayBitBucket<N, T>
where T: RefUnwindSafe,

§

impl<const N: usize, T> Send for ArrayBitBucket<N, T>
where T: Send,

§

impl<const N: usize, T> Sync for ArrayBitBucket<N, T>
where T: Sync,

§

impl<const N: usize, T> Unpin for ArrayBitBucket<N, T>
where T: Unpin,

§

impl<const N: usize, T> UnwindSafe for ArrayBitBucket<N, T>
where T: 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> 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.