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

pub struct LBNumRef<'a>(_);

A borrowed Linked Bytes number, providing access to the data as a number while not owning it.

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.

Implementations

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

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

Constructs an LBNumRef referring to the specified Linked Byte slice.

Safety

The sequence must be a valid Linked Bytes number.

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

Returns the number of bytes in the number.

pub const 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<'_> DivRemAssign<LBNumRef<'_>> for LBNum[src]

type Remainder = Self

The type for the remainder.

fn div_rem_assign(&mut self, rhs: LBNumRef) -> Self[src]

Performs in-place integer division combined with returning the remainder.

Panics

Dividing by 0 triggers an immediate panic.

impl<'_> Eq for LBNumRef<'_>[src]

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

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

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

impl<'_> PartialEq<LBNumRef<'_>> for LBNumRef<'_>[src]

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

impl<'_> PartialEq<LBNumRef<'_>> for u8[src]

impl<'_> PartialEq<LBNumRef<'_>> for u16[src]

impl<'_> PartialEq<LBNumRef<'_>> for u32[src]

impl<'_> PartialEq<LBNumRef<'_>> for u64[src]

impl<'_> PartialEq<LBNumRef<'_>> for u128[src]

impl<'_> PartialEq<LBNumRef<'_>> for usize[src]

impl<'_> PartialEq<u128> for LBNumRef<'_>[src]

impl<'_> PartialEq<u16> for LBNumRef<'_>[src]

impl<'_> PartialEq<u32> for LBNumRef<'_>[src]

impl<'_> PartialEq<u64> for LBNumRef<'_>[src]

impl<'_> PartialEq<u8> for LBNumRef<'_>[src]

impl<'_> PartialEq<usize> for LBNumRef<'_>[src]

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

impl<'_> PartialOrd<LBNumRef<'_>> for LBNumRef<'_>[src]

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

impl<'_> PartialOrd<LBNumRef<'_>> for u8[src]

fn partial_cmp(&self, rhs: &LBNumRef) -> Option<Ordering>[src]

Compares self and rhs.

Never fails, a return value of Some can be relied upon.

impl<'_> PartialOrd<LBNumRef<'_>> for u16[src]

fn partial_cmp(&self, rhs: &LBNumRef) -> Option<Ordering>[src]

Compares self and rhs.

Never fails, a return value of Some can be relied upon.

impl<'_> PartialOrd<LBNumRef<'_>> for u32[src]

fn partial_cmp(&self, rhs: &LBNumRef) -> Option<Ordering>[src]

Compares self and rhs.

Never fails, a return value of Some can be relied upon.

impl<'_> PartialOrd<LBNumRef<'_>> for u64[src]

fn partial_cmp(&self, rhs: &LBNumRef) -> Option<Ordering>[src]

Compares self and rhs.

Never fails, a return value of Some can be relied upon.

impl<'_> PartialOrd<LBNumRef<'_>> for u128[src]

fn partial_cmp(&self, rhs: &LBNumRef) -> Option<Ordering>[src]

Compares self and rhs.

Never fails, a return value of Some can be relied upon.

impl<'_> PartialOrd<LBNumRef<'_>> for usize[src]

fn partial_cmp(&self, rhs: &LBNumRef) -> Option<Ordering>[src]

Compares self and rhs.

Never fails, a return value of Some can be relied upon.

impl<'_> PartialOrd<u128> for LBNumRef<'_>[src]

fn partial_cmp(&self, rhs: &u128) -> Option<Ordering>[src]

Compares self and rhs.

Never fails, a return value of Some can be relied upon.

impl<'_> PartialOrd<u16> for LBNumRef<'_>[src]

fn partial_cmp(&self, rhs: &u16) -> Option<Ordering>[src]

Compares self and rhs.

Never fails, a return value of Some can be relied upon.

impl<'_> PartialOrd<u32> for LBNumRef<'_>[src]

fn partial_cmp(&self, rhs: &u32) -> Option<Ordering>[src]

Compares self and rhs.

Never fails, a return value of Some can be relied upon.

impl<'_> PartialOrd<u64> for LBNumRef<'_>[src]

fn partial_cmp(&self, rhs: &u64) -> Option<Ordering>[src]

Compares self and rhs.

Never fails, a return value of Some can be relied upon.

impl<'_> PartialOrd<u8> for LBNumRef<'_>[src]

fn partial_cmp(&self, rhs: &u8) -> Option<Ordering>[src]

Compares self and rhs.

Never fails, a return value of Some can be relied upon.

impl<'_> PartialOrd<usize> for LBNumRef<'_>[src]

fn partial_cmp(&self, rhs: &usize) -> Option<Ordering>[src]

Compares self and rhs.

Never fails, a return value of Some can be relied upon.

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> RefUnwindSafe for LBNumRef<'a>

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

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

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

impl<'a> UnwindSafe 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.