[−][src]Struct bigbit::linkedbytes::LBNumRef
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]
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]
fn clone(&self) -> LBNumRef<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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<'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.
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
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>,