Struct cbor_data::value::Exponential
source · [−]pub struct Exponential<'a, B: Base> { /* private fields */ }Expand description
A representation of a bignum
The base is statically known while the exponent is dynamic. The mantissa is not guaranteed to have optimal encoding, i.e. it can have leading zero bytes.
The represented value is m * base.pow(exponent), where
m = mantissaforinverted == false, andm = -1 - mantissaforinverted = true.
Implementations
sourceimpl<'a, B: Base> Exponential<'a, B>
impl<'a, B: Base> Exponential<'a, B>
pub fn new(exponent: i128, mantissa: Cow<'a, [u8]>, inverted: bool) -> Self
sourcepub fn make_static(self) -> Exponential<'static, B>
pub fn make_static(self) -> Exponential<'static, B>
Cut ties with possibly referenced byte slices, allocating if necessary
Trait Implementations
sourceimpl<'a, B: Clone + Base> Clone for Exponential<'a, B>
impl<'a, B: Clone + Base> Clone for Exponential<'a, B>
sourcefn clone(&self) -> Exponential<'a, B>
fn clone(&self) -> Exponential<'a, B>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl<'a, B: Debug + Base> Debug for Exponential<'a, B>
impl<'a, B: Debug + Base> Debug for Exponential<'a, B>
sourceimpl<'a, B: Hash + Base> Hash for Exponential<'a, B>
impl<'a, B: Hash + Base> Hash for Exponential<'a, B>
sourceimpl<'a, B: PartialEq + Base> PartialEq<Exponential<'a, B>> for Exponential<'a, B>
impl<'a, B: PartialEq + Base> PartialEq<Exponential<'a, B>> for Exponential<'a, B>
sourcefn eq(&self, other: &Exponential<'a, B>) -> bool
fn eq(&self, other: &Exponential<'a, B>) -> bool
impl<'a, B: Base> StructuralPartialEq for Exponential<'a, B>
Auto Trait Implementations
impl<'a, B> RefUnwindSafe for Exponential<'a, B>where
B: RefUnwindSafe,
impl<'a, B> Send for Exponential<'a, B>where
B: Send,
impl<'a, B> Sync for Exponential<'a, B>where
B: Sync,
impl<'a, B> Unpin for Exponential<'a, B>where
B: Unpin,
impl<'a, B> UnwindSafe for Exponential<'a, B>where
B: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more