[][src]Struct bigbit::linkedbytes::LBNumRef

pub struct LBNumRef<'a>(_);

A Linked Bytes number behind a reference.

The borrow checker ensures that the inner data will never be an invalid LB sequence, meaning that after the TryFrom check has passed, there's no way that any external code will tamper the borrowed slice.

Methods

impl<'a> LBNumRef<'a>[src]

pub const fn new(op: &'a [LinkedByte]) -> Self[src]

Constructs an LBNumRef referring to the specified Linked Byte slice.

pub fn len(self) -> usize[src]

Returns the number of bytes in the number.

pub fn is_empty(self) -> bool[src]

Returns true if the number is 0, false otherwise.

pub fn iter_le(
    self
) -> impl Iterator<Item = LinkedByte> + DoubleEndedIterator + 'a
[src]

Returns a by-value iterator over the linked bytes, in little endian byte order.

pub fn iter_be(
    self
) -> impl Iterator<Item = LinkedByte> + DoubleEndedIterator + 'a
[src]

Returns a by-value iterator over the linked bytes, in big endian byte order.

pub fn into_owned(self) -> LBNum[src]

Converts an LBNumRef into an owned LBNumRef. This dereferences and clones the contents.

pub const fn inner(self) -> &'a [LinkedByte][src]

Returns the inner Linked Byte buffer.

Trait Implementations

impl<'_> Add<LBNumRef<'_>> for LBNum[src]

type Output = Self

The resulting type after applying the + operator.

impl<'_> AddAssign<LBNumRef<'_>> for LBNum[src]

impl<'a> Clone for LBNumRef<'a>[src]

impl<'a> Copy for LBNumRef<'a>[src]

impl<'a> Debug for LBNumRef<'a>[src]

impl<'a> Deref for LBNumRef<'a>[src]

type Target = [LinkedByte]

The resulting type after dereferencing.

impl<'a> From<&'a LBNum> for LBNumRef<'a>[src]

impl<'a> TryFrom<&'a [LinkedByte]> for LBNumRef<'a>[src]

type Error = InvalidLBSequence

The type returned in the event of a conversion error.

impl<'a> TryFrom<LBNumRef<'a>> for u8[src]

type Error = TryFromIntError

The type returned in the event of a conversion error.

impl<'a> TryFrom<LBNumRef<'a>> for u16[src]

type Error = TryFromIntError

The type returned in the event of a conversion error.

impl<'a> TryFrom<LBNumRef<'a>> for isize[src]

type Error = TryFromIntError

The type returned in the event of a conversion error.

impl<'a> TryFrom<LBNumRef<'a>> for i16[src]

type Error = TryFromIntError

The type returned in the event of a conversion error.

impl<'a> TryFrom<LBNumRef<'a>> for u32[src]

type Error = TryFromIntError

The type returned in the event of a conversion error.

impl<'a> TryFrom<LBNumRef<'a>> for i32[src]

type Error = TryFromIntError

The type returned in the event of a conversion error.

impl<'a> TryFrom<LBNumRef<'a>> for u64[src]

type Error = TryFromIntError

The type returned in the event of a conversion error.

impl<'a> TryFrom<LBNumRef<'a>> for i64[src]

type Error = TryFromIntError

The type returned in the event of a conversion error.

impl<'a> TryFrom<LBNumRef<'a>> for u128[src]

type Error = TryFromIntError

The type returned in the event of a conversion error.

impl<'a> TryFrom<LBNumRef<'a>> for i128[src]

type Error = TryFromIntError

The type returned in the event of a conversion error.

impl<'a> TryFrom<LBNumRef<'a>> for usize[src]

type Error = TryFromIntError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<'a> Send for LBNumRef<'a>

impl<'a> Sync for LBNumRef<'a>

impl<'a> Unpin for LBNumRef<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.