Struct rasn_mib::tcp::RtoAlgorithm  
source · #[repr(transparent)]pub struct RtoAlgorithm(pub Integer);Expand description
The algorithm used to determine the timeout value used for retransmitting unacknowledged octets.
Tuple Fields§
§0: IntegerImplementations§
Methods from Deref<Target = Integer>§
sourcepub fn assign_from_slice(&mut self, sign: Sign, slice: &[u32])
 
pub fn assign_from_slice(&mut self, sign: Sign, slice: &[u32])
Reinitializes a BigInt.
The base 232 digits are ordered least significant digit first.
sourcepub fn to_u32_digits(&self) -> (Sign, Vec<u32, Global>)
 
pub fn to_u32_digits(&self) -> (Sign, Vec<u32, Global>)
Returns the sign and the u32 digits representation of the BigInt ordered least
significant digit first.
Examples
use num_bigint::{BigInt, Sign};
assert_eq!(BigInt::from(-1125).to_u32_digits(), (Sign::Minus, vec![1125]));
assert_eq!(BigInt::from(4294967295u32).to_u32_digits(), (Sign::Plus, vec![4294967295]));
assert_eq!(BigInt::from(4294967296u64).to_u32_digits(), (Sign::Plus, vec![0, 1]));
assert_eq!(BigInt::from(-112500000000i64).to_u32_digits(), (Sign::Minus, vec![830850304, 26]));
assert_eq!(BigInt::from(112500000000i64).to_u32_digits(), (Sign::Plus, vec![830850304, 26]));sourcepub fn to_u64_digits(&self) -> (Sign, Vec<u64, Global>)
 
pub fn to_u64_digits(&self) -> (Sign, Vec<u64, Global>)
Returns the sign and the u64 digits representation of the BigInt ordered least
significant digit first.
Examples
use num_bigint::{BigInt, Sign};
assert_eq!(BigInt::from(-1125).to_u64_digits(), (Sign::Minus, vec![1125]));
assert_eq!(BigInt::from(4294967295u32).to_u64_digits(), (Sign::Plus, vec![4294967295]));
assert_eq!(BigInt::from(4294967296u64).to_u64_digits(), (Sign::Plus, vec![4294967296]));
assert_eq!(BigInt::from(-112500000000i64).to_u64_digits(), (Sign::Minus, vec![112500000000]));
assert_eq!(BigInt::from(112500000000i64).to_u64_digits(), (Sign::Plus, vec![112500000000]));
assert_eq!(BigInt::from(1u128 << 64).to_u64_digits(), (Sign::Plus, vec![0, 1]));sourcepub fn iter_u32_digits(&self) -> U32Digits<'_>
 
pub fn iter_u32_digits(&self) -> U32Digits<'_>
Returns an iterator of u32 digits representation of the BigInt ordered least
significant digit first.
Examples
use num_bigint::BigInt;
assert_eq!(BigInt::from(-1125).iter_u32_digits().collect::<Vec<u32>>(), vec![1125]);
assert_eq!(BigInt::from(4294967295u32).iter_u32_digits().collect::<Vec<u32>>(), vec![4294967295]);
assert_eq!(BigInt::from(4294967296u64).iter_u32_digits().collect::<Vec<u32>>(), vec![0, 1]);
assert_eq!(BigInt::from(-112500000000i64).iter_u32_digits().collect::<Vec<u32>>(), vec![830850304, 26]);
assert_eq!(BigInt::from(112500000000i64).iter_u32_digits().collect::<Vec<u32>>(), vec![830850304, 26]);sourcepub fn iter_u64_digits(&self) -> U64Digits<'_>
 
pub fn iter_u64_digits(&self) -> U64Digits<'_>
Returns an iterator of u64 digits representation of the BigInt ordered least
significant digit first.
Examples
use num_bigint::BigInt;
assert_eq!(BigInt::from(-1125).iter_u64_digits().collect::<Vec<u64>>(), vec![1125u64]);
assert_eq!(BigInt::from(4294967295u32).iter_u64_digits().collect::<Vec<u64>>(), vec![4294967295u64]);
assert_eq!(BigInt::from(4294967296u64).iter_u64_digits().collect::<Vec<u64>>(), vec![4294967296u64]);
assert_eq!(BigInt::from(-112500000000i64).iter_u64_digits().collect::<Vec<u64>>(), vec![112500000000u64]);
assert_eq!(BigInt::from(112500000000i64).iter_u64_digits().collect::<Vec<u64>>(), vec![112500000000u64]);
assert_eq!(BigInt::from(1u128 << 64).iter_u64_digits().collect::<Vec<u64>>(), vec![0, 1]);sourcepub fn to_str_radix(&self, radix: u32) -> String
 
pub fn to_str_radix(&self, radix: u32) -> String
Returns the integer formatted as a string in the given radix.
radix must be in the range 2...36.
Examples
use num_bigint::BigInt;
let i = BigInt::parse_bytes(b"ff", 16).unwrap();
assert_eq!(i.to_str_radix(16), "ff");sourcepub fn to_radix_be(&self, radix: u32) -> (Sign, Vec<u8, Global>)
 
pub fn to_radix_be(&self, radix: u32) -> (Sign, Vec<u8, Global>)
Returns the integer in the requested base in big-endian digit order.
The output is not given in a human readable alphabet but as a zero
based u8 number.
radix must be in the range 2...256.
Examples
use num_bigint::{BigInt, Sign};
assert_eq!(BigInt::from(-0xFFFFi64).to_radix_be(159),
           (Sign::Minus, vec![2, 94, 27]));
// 0xFFFF = 65535 = 2*(159^2) + 94*159 + 27sourcepub fn to_radix_le(&self, radix: u32) -> (Sign, Vec<u8, Global>)
 
pub fn to_radix_le(&self, radix: u32) -> (Sign, Vec<u8, Global>)
Returns the integer in the requested base in little-endian digit order.
The output is not given in a human readable alphabet but as a zero
based u8 number.
radix must be in the range 2...256.
Examples
use num_bigint::{BigInt, Sign};
assert_eq!(BigInt::from(-0xFFFFi64).to_radix_le(159),
           (Sign::Minus, vec![27, 94, 2]));
// 0xFFFF = 65535 = 27 + 94*159 + 2*(159^2)sourcepub fn magnitude(&self) -> &BigUint
 
pub fn magnitude(&self) -> &BigUint
Returns the magnitude of the BigInt as a BigUint.
Examples
use num_bigint::{BigInt, BigUint};
use num_traits::Zero;
assert_eq!(BigInt::from(1234).magnitude(), &BigUint::from(1234u32));
assert_eq!(BigInt::from(-4321).magnitude(), &BigUint::from(4321u32));
assert!(BigInt::zero().magnitude().is_zero());sourcepub fn bits(&self) -> u64
 
pub fn bits(&self) -> u64
Determines the fewest bits necessary to express the BigInt,
not including the sign.
sourcepub fn to_biguint(&self) -> Option<BigUint>
 
pub fn to_biguint(&self) -> Option<BigUint>
pub fn checked_add(&self, v: &BigInt) -> Option<BigInt>
pub fn checked_sub(&self, v: &BigInt) -> Option<BigInt>
pub fn checked_mul(&self, v: &BigInt) -> Option<BigInt>
pub fn checked_div(&self, v: &BigInt) -> Option<BigInt>
sourcepub fn modpow(&self, exponent: &BigInt, modulus: &BigInt) -> BigInt
 
pub fn modpow(&self, exponent: &BigInt, modulus: &BigInt) -> BigInt
Returns (self ^ exponent) mod modulus
Note that this rounds like mod_floor, not like the % operator,
which makes a difference when given a negative self or modulus.
The result will be in the interval [0, modulus) for modulus > 0,
or in the interval (modulus, 0] for modulus < 0
Panics if the exponent is negative or the modulus is zero.
sourcepub fn sqrt(&self) -> BigInt
 
pub fn sqrt(&self) -> BigInt
Returns the truncated principal square root of self –
see num_integer::Roots::sqrt().
sourcepub fn cbrt(&self) -> BigInt
 
pub fn cbrt(&self) -> BigInt
Returns the truncated principal cube root of self –
see num_integer::Roots::cbrt().
sourcepub fn nth_root(&self, n: u32) -> BigInt
 
pub fn nth_root(&self, n: u32) -> BigInt
Returns the truncated principal nth root of self –
See num_integer::Roots::nth_root().
sourcepub fn trailing_zeros(&self) -> Option<u64>
 
pub fn trailing_zeros(&self) -> Option<u64>
Returns the number of least-significant bits that are zero,
or None if the entire number is zero.
sourcepub fn bit(&self, bit: u64) -> bool
 
pub fn bit(&self, bit: u64) -> bool
Returns whether the bit in position bit is set,
using the two’s complement for negative numbers
sourcepub fn set_bit(&mut self, bit: u64, value: bool)
 
pub fn set_bit(&mut self, bit: u64, value: bool)
Sets or clears the bit in the given position, using the two’s complement for negative numbers
Note that setting/clearing a bit (for positive/negative numbers, respectively) greater than the current bit length, a reallocation may be needed to store the new digits
Trait Implementations§
source§impl AsnType for RtoAlgorithm
 
impl AsnType for RtoAlgorithm
source§const TAG: Tag = <Integer as ::rasn_smi::rasn::AsnType>::TAG
 
const TAG: Tag = <Integer as ::rasn_smi::rasn::AsnType>::TAG
source§const TAG_TREE: TagTree = TagTree::Leaf(Self::TAG)
 
const TAG_TREE: TagTree = TagTree::Leaf(Self::TAG)
Leaf that points Self::TAG.const CONSTRAINTS: Constraints<'static> = Constraints::NONE
source§impl Clone for RtoAlgorithm
 
impl Clone for RtoAlgorithm
source§fn clone(&self) -> RtoAlgorithm
 
fn clone(&self) -> RtoAlgorithm
1.0.0 · source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for RtoAlgorithm
 
impl Debug for RtoAlgorithm
source§impl Decode for RtoAlgorithm
 
impl Decode for RtoAlgorithm
fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>
source§fn decode<D>(decoder: &mut D) -> Result<Self, <D as Decoder>::Error>where
    D: Decoder,
 
fn decode<D>(decoder: &mut D) -> Result<Self, <D as Decoder>::Error>where D: Decoder,
source§fn decode_with_tag<D>(
    decoder: &mut D,
    tag: Tag
) -> Result<Self, <D as Decoder>::Error>where
    D: Decoder,
 
fn decode_with_tag<D>( decoder: &mut D, tag: Tag ) -> Result<Self, <D as Decoder>::Error>where D: Decoder,
tag from a given ASN.1 decoder. Read morefn decode_with_constraints<D>( decoder: &mut D, constraints: Constraints<'_> ) -> Result<Self, <D as Decoder>::Error>where D: Decoder,
source§impl Deref for RtoAlgorithm
 
impl Deref for RtoAlgorithm
source§impl DerefMut for RtoAlgorithm
 
impl DerefMut for RtoAlgorithm
source§impl Encode for RtoAlgorithm
 
impl Encode for RtoAlgorithm
fn encode_with_tag_and_constraints<EN: Encoder>( &self, encoder: &mut EN, tag: Tag, constraints: Constraints<'_> ) -> Result<(), EN::Error>
source§fn encode_with_tag<E>(
    &self,
    encoder: &mut E,
    tag: Tag
) -> Result<(), <E as Encoder>::Error>where
    E: Encoder,
 
fn encode_with_tag<E>( &self, encoder: &mut E, tag: Tag ) -> Result<(), <E as Encoder>::Error>where E: Encoder,
fn encode_with_constraints<E>( &self, encoder: &mut E, constraints: Constraints<'_> ) -> Result<(), <E as Encoder>::Error>where E: Encoder,
source§impl From<BigInt> for RtoAlgorithm
 
impl From<BigInt> for RtoAlgorithm
source§impl From<RtoAlgorithm> for Integer
 
impl From<RtoAlgorithm> for Integer
source§fn from(value: RtoAlgorithm) -> Self
 
fn from(value: RtoAlgorithm) -> Self
source§impl Hash for RtoAlgorithm
 
impl Hash for RtoAlgorithm
source§impl ObjectType for RtoAlgorithm
 
impl ObjectType for RtoAlgorithm
source§impl Ord for RtoAlgorithm
 
impl Ord for RtoAlgorithm
source§fn cmp(&self, other: &RtoAlgorithm) -> Ordering
 
fn cmp(&self, other: &RtoAlgorithm) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<RtoAlgorithm> for RtoAlgorithm
 
impl PartialEq<RtoAlgorithm> for RtoAlgorithm
source§fn eq(&self, other: &RtoAlgorithm) -> bool
 
fn eq(&self, other: &RtoAlgorithm) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd<RtoAlgorithm> for RtoAlgorithm
 
impl PartialOrd<RtoAlgorithm> for RtoAlgorithm
source§fn partial_cmp(&self, other: &RtoAlgorithm) -> Option<Ordering>
 
fn partial_cmp(&self, other: &RtoAlgorithm) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
 
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moreimpl Eq for RtoAlgorithm
impl StructuralEq for RtoAlgorithm
impl StructuralPartialEq for RtoAlgorithm
Auto Trait Implementations§
impl RefUnwindSafe for RtoAlgorithm
impl Send for RtoAlgorithm
impl Sync for RtoAlgorithm
impl Unpin for RtoAlgorithm
impl UnwindSafe for RtoAlgorithm
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
§impl<T> Conv for T
 
impl<T> Conv for T
§impl<T> FmtForward for T
 
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
    Self: Binary,
 
fn fmt_binary(self) -> FmtBinary<Self>where Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
    Self: Display,
 
fn fmt_display(self) -> FmtDisplay<Self>where Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
    Self: LowerExp,
 
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
    Self: LowerHex,
 
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
    Self: Octal,
 
fn fmt_octal(self) -> FmtOctal<Self>where Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
    Self: Pointer,
 
fn fmt_pointer(self) -> FmtPointer<Self>where Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
    Self: UpperExp,
 
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
    Self: UpperHex,
 
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
    &'a Self: for<'a> IntoIterator,
 
fn fmt_list(self) -> FmtList<Self>where &'a Self: for<'a> IntoIterator,
§impl<T> Identity for Twhere
    T: ?Sized,
 
impl<T> Identity for Twhere T: ?Sized,
§impl<T> Pipe for Twhere
    T: ?Sized,
 
impl<T> Pipe for Twhere T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
    Self: Sized,
 
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
    R: 'a,
 
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
    R: 'a,
 
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
    Self: Borrow<B>,
    B: 'a + ?Sized,
    R: 'a,
 
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere Self: Borrow<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_borrow_mut<'a, B, R>(
    &'a mut self,
    func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
    Self: BorrowMut<B>,
    B: 'a + ?Sized,
    R: 'a,
 
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> Rwhere Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
    Self: AsRef<U>,
    U: 'a + ?Sized,
    R: 'a,
 
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere Self: AsRef<U>, U: 'a + ?Sized, R: 'a,
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
    Self: AsMut<U>,
    U: 'a + ?Sized,
    R: 'a,
 
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere Self: AsMut<U>, U: 'a + ?Sized, R: 'a,
self, then passes self.as_mut() into the pipe
function.§impl<T> Tap for T
 
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
    Self: Borrow<B>,
    B: ?Sized,
 
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
    Self: BorrowMut<B>,
    B: ?Sized,
 
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
    Self: AsRef<R>,
    R: ?Sized,
 
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
    Self: AsMut<R>,
    R: ?Sized,
 
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
    Self: Deref<Target = T>,
    T: ?Sized,
 
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
    Self: DerefMut<Target = T> + Deref,
    T: ?Sized,
 
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
 
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
 
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
    Self: Borrow<B>,
    B: ?Sized,
 
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
    Self: BorrowMut<B>,
    B: ?Sized,
 
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
    Self: AsRef<R>,
    R: ?Sized,
 
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
    Self: AsMut<R>,
    R: ?Sized,
 
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
.tap_ref_mut() only in debug builds, and is erased in release
builds.