[−][src]Struct bigbit::linkedbytes::LBNumRef
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]
self
) -> impl Iterator<Item = LinkedByte> + DoubleEndedIterator + 'a
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]
self
) -> impl Iterator<Item = LinkedByte> + DoubleEndedIterator + 'a
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.
fn add(self, rhs: LBNumRef) -> Self
[src]
impl<'_> AddAssign<LBNumRef<'_>> for LBNum
[src]
fn add_assign(&mut self, rhs: LBNumRef)
[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.
fn deref(&self) -> &Self::Target
[src]
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]
fn cmp(&self, rhs: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[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]
fn partial_cmp(&self, rhs: &LBNum) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<LBNumRef<'_>> for LBNumRef<'_>
[src]
fn partial_cmp(&self, rhs: &Self) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<LBNumRef<'_>> for LBNum
[src]
fn partial_cmp(&self, rhs: &LBNumRef) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[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.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
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.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
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.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
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.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
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.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
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.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
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.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
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.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
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.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
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.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
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.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
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.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> TryFrom<&'a [LinkedByte]> for LBNumRef<'a>
[src]
type Error = InvalidLBSequence
The type returned in the event of a conversion error.
fn try_from(op: &'a [LinkedByte]) -> Result<Self, InvalidLBSequence>
[src]
impl<'a> TryFrom<LBNumRef<'a>> for u8
[src]
type Error = TryFromIntError
The type returned in the event of a conversion error.
fn try_from(op: LBNumRef<'a>) -> Result<Self, TryFromIntError>
[src]
impl<'a> TryFrom<LBNumRef<'a>> for u16
[src]
type Error = TryFromIntError
The type returned in the event of a conversion error.
fn try_from(op: LBNumRef<'a>) -> Result<Self, TryFromIntError>
[src]
impl<'a> TryFrom<LBNumRef<'a>> for isize
[src]
type Error = TryFromIntError
The type returned in the event of a conversion error.
fn try_from(op: LBNumRef<'a>) -> Result<Self, TryFromIntError>
[src]
impl<'a> TryFrom<LBNumRef<'a>> for i16
[src]
type Error = TryFromIntError
The type returned in the event of a conversion error.
fn try_from(op: LBNumRef<'a>) -> Result<Self, TryFromIntError>
[src]
impl<'a> TryFrom<LBNumRef<'a>> for u32
[src]
type Error = TryFromIntError
The type returned in the event of a conversion error.
fn try_from(op: LBNumRef<'a>) -> Result<Self, TryFromIntError>
[src]
impl<'a> TryFrom<LBNumRef<'a>> for i32
[src]
type Error = TryFromIntError
The type returned in the event of a conversion error.
fn try_from(op: LBNumRef<'a>) -> Result<Self, TryFromIntError>
[src]
impl<'a> TryFrom<LBNumRef<'a>> for u64
[src]
type Error = TryFromIntError
The type returned in the event of a conversion error.
fn try_from(op: LBNumRef<'a>) -> Result<Self, TryFromIntError>
[src]
impl<'a> TryFrom<LBNumRef<'a>> for i64
[src]
type Error = TryFromIntError
The type returned in the event of a conversion error.
fn try_from(op: LBNumRef<'a>) -> Result<Self, TryFromIntError>
[src]
impl<'a> TryFrom<LBNumRef<'a>> for u128
[src]
type Error = TryFromIntError
The type returned in the event of a conversion error.
fn try_from(op: LBNumRef<'a>) -> Result<Self, TryFromIntError>
[src]
impl<'a> TryFrom<LBNumRef<'a>> for i128
[src]
type Error = TryFromIntError
The type returned in the event of a conversion error.
fn try_from(op: LBNumRef<'a>) -> Result<Self, TryFromIntError>
[src]
impl<'a> TryFrom<LBNumRef<'a>> for usize
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,