Enum tor_interface::legacy_tor_version::Error
source · pub enum Error {
ParseError(String),
}
Expand description
LegacyTorVersion
-specific error type
Variants§
Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Variants§
Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
fn implicit(
diff --git a/crates/tor_interface/mock_tor_client/enum.Error.html b/crates/tor_interface/mock_tor_client/enum.Error.html
index 7d7d513c..8f1a9db9 100644
--- a/crates/tor_interface/mock_tor_client/enum.Error.html
+++ b/crates/tor_interface/mock_tor_client/enum.Error.html
@@ -10,7 +10,7 @@
ConnectFailed(TargetAddr),
NotImplemented(),
}Expand description
MockTorClient
-specific error type
-Variants§
§ClientNotBootstrapped()
§ClientAlreadyBootstrapped()
§OnionServiceNotFound(OnionAddr)
§OnionServiceNotPublished(OnionAddr)
§OnionServiceRequiresOnionAuth()
§OnionServiceAuthInvalid()
§TcpListenerBindFailed(Error)
§TcpListenerLocalAddrFailed(Error)
§ConnectFailed(TargetAddr)
§NotImplemented()
Trait Implementations§
source§impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for Error
§impl !RefUnwindSafe for Error
§impl Send for Error
§impl Sync for Error
§impl Unpin for Error
§impl !UnwindSafe for Error
Blanket Implementations§
Variants§
§ClientNotBootstrapped()
§ClientAlreadyBootstrapped()
§OnionServiceNotFound(OnionAddr)
§OnionServiceNotPublished(OnionAddr)
§OnionServiceRequiresOnionAuth()
§OnionServiceAuthInvalid()
§TcpListenerBindFailed(Error)
§TcpListenerLocalAddrFailed(Error)
§ConnectFailed(TargetAddr)
§NotImplemented()
Trait Implementations§
source§impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for Error
§impl !RefUnwindSafe for Error
§impl Send for Error
§impl Sync for Error
§impl Unpin for Error
§impl !UnwindSafe for Error
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Variants§
§Socks4(Socks4ProxyConfig)
A SOCKS4 proxy
§Socks5(Socks5ProxyConfig)
A SOCKS5 proxy
§Https(HttpsProxyConfig)
An HTTP CONNECT proxy
-Trait Implementations§
source§impl Clone for ProxyConfig
source§fn clone(&self) -> ProxyConfig
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ProxyConfig
source§impl From<HttpsProxyConfig> for ProxyConfig
source§fn from(config: HttpsProxyConfig) -> Self
Converts to this type from the input type.source§impl From<Socks4ProxyConfig> for ProxyConfig
source§fn from(config: Socks4ProxyConfig) -> Self
Converts to this type from the input type.source§impl From<Socks5ProxyConfig> for ProxyConfig
source§fn from(config: Socks5ProxyConfig) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for ProxyConfig
§impl RefUnwindSafe for ProxyConfig
§impl Send for ProxyConfig
§impl Sync for ProxyConfig
§impl Unpin for ProxyConfig
§impl UnwindSafe for ProxyConfig
Blanket Implementations§
Trait Implementations§
source§impl Clone for ProxyConfig
source§fn clone(&self) -> ProxyConfig
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ProxyConfig
source§impl From<HttpsProxyConfig> for ProxyConfig
source§fn from(config: HttpsProxyConfig) -> Self
Converts to this type from the input type.source§impl From<Socks4ProxyConfig> for ProxyConfig
source§fn from(config: Socks4ProxyConfig) -> Self
Converts to this type from the input type.source§impl From<Socks5ProxyConfig> for ProxyConfig
source§fn from(config: Socks5ProxyConfig) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl Freeze for ProxyConfig
§impl RefUnwindSafe for ProxyConfig
§impl Send for ProxyConfig
§impl Sync for ProxyConfig
§impl Unpin for ProxyConfig
§impl UnwindSafe for ProxyConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/crates/tor_interface/proxy/enum.ProxyConfigError.html b/crates/tor_interface/proxy/enum.ProxyConfigError.html
index 2e60ba2f..b61a46da 100644
--- a/crates/tor_interface/proxy/enum.ProxyConfigError.html
+++ b/crates/tor_interface/proxy/enum.ProxyConfigError.html
@@ -2,7 +2,7 @@
Generic(String),
}Expand description
Error type for the proxy module
Variants§
Trait Implementations§
source§impl Debug for ProxyConfigError
source§impl Display for ProxyConfigError
source§impl Error for ProxyConfigError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for ProxyConfigError
§impl RefUnwindSafe for ProxyConfigError
§impl Send for ProxyConfigError
§impl Sync for ProxyConfigError
§impl Unpin for ProxyConfigError
§impl UnwindSafe for ProxyConfigError
Blanket Implementations§
Trait Implementations§
source§impl Debug for ProxyConfigError
source§impl Display for ProxyConfigError
source§impl Error for ProxyConfigError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for ProxyConfigError
§impl RefUnwindSafe for ProxyConfigError
§impl Send for ProxyConfigError
§impl Sync for ProxyConfigError
§impl Unpin for ProxyConfigError
§impl UnwindSafe for ProxyConfigError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/crates/tor_interface/tor_crypto/enum.SignBit.html b/crates/tor_interface/tor_crypto/enum.SignBit.html
index c7f445ee..46527642 100644
--- a/crates/tor_interface/tor_crypto/enum.SignBit.html
+++ b/crates/tor_interface/tor_crypto/enum.SignBit.html
@@ -2,7 +2,7 @@
Zero,
One,
}Expand description
An enum representing a single bit
-Variants§
Trait Implementations§
source§impl Copy for SignBit
Auto Trait Implementations§
§impl Freeze for SignBit
§impl RefUnwindSafe for SignBit
§impl Send for SignBit
§impl Sync for SignBit
§impl Unpin for SignBit
§impl UnwindSafe for SignBit
Blanket Implementations§
Variants§
Trait Implementations§
source§impl Copy for SignBit
Auto Trait Implementations§
§impl Freeze for SignBit
§impl RefUnwindSafe for SignBit
§impl Send for SignBit
§impl Sync for SignBit
§impl Unpin for SignBit
§impl UnwindSafe for SignBit
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html b/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html
index 415df0b0..d7f04cb7 100644
--- a/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html
+++ b/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html
@@ -16,7 +16,7 @@
sourcepub fn from_private_key(private_key: &Ed25519PrivateKey) -> V3OnionServiceId
Create a V3OnionServiceId
from an Ed25519PrivateKey
.
Trait Implementations§
source§impl Clone for V3OnionServiceId
source§fn clone(&self) -> V3OnionServiceId
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for V3OnionServiceId
source§impl Display for V3OnionServiceId
Trait Implementations§
source§impl Clone for V3OnionServiceId
source§fn clone(&self) -> V3OnionServiceId
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for V3OnionServiceId
source§impl Display for V3OnionServiceId
source§impl Hash for V3OnionServiceId
source§impl Ord for V3OnionServiceId
source§fn cmp(&self, other: &V3OnionServiceId) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/tor_interface/tor_provider/enum.OnionAddr.html b/crates/tor_interface/tor_provider/enum.OnionAddr.html
index 330e8dc7..212631b0 100644
--- a/crates/tor_interface/tor_provider/enum.OnionAddr.html
+++ b/crates/tor_interface/tor_provider/enum.OnionAddr.html
@@ -1,7 +1,7 @@
OnionAddr in tor_interface::tor_provider - Rust Enum tor_interface::tor_provider::OnionAddr
source · pub enum OnionAddr {
V3(OnionAddrV3),
}
Expand description
An onion service address analog to std::net::SocketAddr
-Variants§
§V3(OnionAddrV3)
Trait Implementations§
source§impl Hash for OnionAddr
1.3.0 · source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+
Variants§
§V3(OnionAddrV3)
Trait Implementations§
source§impl Ord for OnionAddr
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/tor_interface/tor_provider/struct.DomainAddr.html b/crates/tor_interface/tor_provider/struct.DomainAddr.html
index 9093e21e..c541ef98 100644
--- a/crates/tor_interface/tor_provider/struct.DomainAddr.html
+++ b/crates/tor_interface/tor_provider/struct.DomainAddr.html
@@ -3,7 +3,7 @@
Implementations§
Trait Implementations§
source§impl Clone for DomainAddr
source§fn clone(&self) -> DomainAddr
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for DomainAddr
source§impl Display for DomainAddr
source§impl FromStr for DomainAddr
Trait Implementations§
source§impl Clone for DomainAddr
source§fn clone(&self) -> DomainAddr
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for DomainAddr
source§impl Display for DomainAddr
source§impl FromStr for DomainAddr
source§impl Hash for DomainAddr
source§impl Ord for DomainAddr
source§fn cmp(&self, other: &DomainAddr) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/type.impl/std/primitive.usize.js b/crates/type.impl/std/primitive.usize.js
index da014e4e..ef01c053 100644
--- a/crates/type.impl/std/primitive.usize.js
+++ b/crates/type.impl/std/primitive.usize.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
-"gosling":[["","Accumulate","gosling::context::HandshakeHandle"],["","Add<&'a BigInt>","gosling::context::HandshakeHandle"],["","Add<&'a BigUint>","gosling::context::HandshakeHandle"],["","Add<&usize>","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","gosling::context::HandshakeHandle"],["","AsAny","gosling::context::HandshakeHandle"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["","Binary","gosling::context::HandshakeHandle"],["","BitAnd<&usize>","gosling::context::HandshakeHandle"],["","BitAnd","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","gosling::context::HandshakeHandle"],["","BitOr<&usize>","gosling::context::HandshakeHandle"],["","BitOr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","gosling::context::HandshakeHandle"],["","BitRegister","gosling::context::HandshakeHandle"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","gosling::context::HandshakeHandle"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","gosling::context::HandshakeHandle"],["","BitXor<&usize>","gosling::context::HandshakeHandle"],["","BitXor","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","gosling::context::HandshakeHandle"],["","Bits","gosling::context::HandshakeHandle"],["","Bounded","gosling::context::HandshakeHandle"],["","CastSigned","gosling::context::HandshakeHandle"],["","CastUnsigned","gosling::context::HandshakeHandle"],["source§impl CheckedAdd for usize
","CheckedAdd","gosling::context::HandshakeHandle"],["source§impl CheckedDiv for usize
","CheckedDiv","gosling::context::HandshakeHandle"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","gosling::context::HandshakeHandle"],["source§impl CheckedMul for usize
","CheckedMul","gosling::context::HandshakeHandle"],["source§impl CheckedNeg for usize
","CheckedNeg","gosling::context::HandshakeHandle"],["source§impl CheckedRem for usize
","CheckedRem","gosling::context::HandshakeHandle"],["source§impl CheckedShl for usize
","CheckedShl","gosling::context::HandshakeHandle"],["source§impl CheckedShr for usize
","CheckedShr","gosling::context::HandshakeHandle"],["source§impl CheckedSub for usize
","CheckedSub","gosling::context::HandshakeHandle"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","gosling::context::HandshakeHandle"],["","Clone","gosling::context::HandshakeHandle"],["","ConstOne","gosling::context::HandshakeHandle"],["","ConstZero","gosling::context::HandshakeHandle"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","gosling::context::HandshakeHandle"],["","Debug","gosling::context::HandshakeHandle"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","gosling::context::HandshakeHandle"],["","Default","gosling::context::HandshakeHandle"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","gosling::context::HandshakeHandle"],["","Display","gosling::context::HandshakeHandle"],["","Div<&'a BigInt>","gosling::context::HandshakeHandle"],["","Div<&'a BigUint>","gosling::context::HandshakeHandle"],["","Div<&usize>","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","gosling::context::HandshakeHandle"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","gosling::context::HandshakeHandle"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","gosling::context::HandshakeHandle"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","gosling::context::HandshakeHandle"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","gosling::context::HandshakeHandle"],["","FmtConst","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","gosling::context::HandshakeHandle"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","gosling::context::HandshakeHandle"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","gosling::context::HandshakeHandle"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","gosling::context::HandshakeHandle"],["","FromStr","gosling::context::HandshakeHandle"],["","FromZeroes","gosling::context::HandshakeHandle"],["","Fundamental","gosling::context::HandshakeHandle"],["","Hash","gosling::context::HandshakeHandle"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","gosling::context::HandshakeHandle"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","gosling::context::HandshakeHandle"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","gosling::context::HandshakeHandle"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","gosling::context::HandshakeHandle"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","gosling::context::HandshakeHandle"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","gosling::context::HandshakeHandle"],["","LowerExp","gosling::context::HandshakeHandle"],["","LowerHex","gosling::context::HandshakeHandle"],["","Mul<&'a BigInt>","gosling::context::HandshakeHandle"],["","Mul<&'a BigUint>","gosling::context::HandshakeHandle"],["","Mul<&usize>","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","MulAdd","gosling::context::HandshakeHandle"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","gosling::context::HandshakeHandle"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","gosling::context::HandshakeHandle"],["","Not","gosling::context::HandshakeHandle"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","gosling::context::HandshakeHandle"],["","NumCast","gosling::context::HandshakeHandle"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","gosling::context::HandshakeHandle"],["","Octal","gosling::context::HandshakeHandle"],["","One","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Ord for usize
","Ord","gosling::context::HandshakeHandle"],["source§impl OverflowingAdd for usize
","OverflowingAdd","gosling::context::HandshakeHandle"],["source§impl OverflowingMul for usize
","OverflowingMul","gosling::context::HandshakeHandle"],["source§impl OverflowingSub for usize
","OverflowingSub","gosling::context::HandshakeHandle"],["","ParseHex","gosling::context::HandshakeHandle"],["source§impl PartialEq<Value> for usize
","PartialEq","gosling::context::HandshakeHandle"],["","PartialEq","gosling::context::HandshakeHandle"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","gosling::context::HandshakeHandle"],["","PhfBorrow","gosling::context::HandshakeHandle"],["","PhfHash","gosling::context::HandshakeHandle"],["","Pow<&'a u16>","gosling::context::HandshakeHandle"],["","Pow<&'a u32>","gosling::context::HandshakeHandle"],["","Pow<&'a u8>","gosling::context::HandshakeHandle"],["","Pow<&'a usize>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","gosling::context::HandshakeHandle"],["","Product<&'a usize>","gosling::context::HandshakeHandle"],["","Product","gosling::context::HandshakeHandle"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","gosling::context::HandshakeHandle"],["","Rem<&'a BigInt>","gosling::context::HandshakeHandle"],["","Rem<&'a BigUint>","gosling::context::HandshakeHandle"],["","Rem<&usize>","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","gosling::context::HandshakeHandle"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","gosling::context::HandshakeHandle"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["source§impl Roots for usize
","Roots","gosling::context::HandshakeHandle"],["","RowIndex","gosling::context::HandshakeHandle"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","gosling::context::HandshakeHandle"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","gosling::context::HandshakeHandle"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","gosling::context::HandshakeHandle"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","gosling::context::HandshakeHandle"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","gosling::context::HandshakeHandle"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","gosling::context::HandshakeHandle"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","gosling::context::HandshakeHandle"],["","Shl<&i128>","gosling::context::HandshakeHandle"],["","Shl<&i16>","gosling::context::HandshakeHandle"],["","Shl<&i32>","gosling::context::HandshakeHandle"],["","Shl<&i64>","gosling::context::HandshakeHandle"],["","Shl<&i8>","gosling::context::HandshakeHandle"],["","Shl<&isize>","gosling::context::HandshakeHandle"],["","Shl<&u128>","gosling::context::HandshakeHandle"],["","Shl<&u16>","gosling::context::HandshakeHandle"],["","Shl<&u32>","gosling::context::HandshakeHandle"],["","Shl<&u64>","gosling::context::HandshakeHandle"],["","Shl<&u8>","gosling::context::HandshakeHandle"],["","Shl<&usize>","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["","Shr<&i128>","gosling::context::HandshakeHandle"],["","Shr<&i16>","gosling::context::HandshakeHandle"],["","Shr<&i32>","gosling::context::HandshakeHandle"],["","Shr<&i64>","gosling::context::HandshakeHandle"],["","Shr<&i8>","gosling::context::HandshakeHandle"],["","Shr<&isize>","gosling::context::HandshakeHandle"],["","Shr<&u128>","gosling::context::HandshakeHandle"],["","Shr<&u16>","gosling::context::HandshakeHandle"],["","Shr<&u32>","gosling::context::HandshakeHandle"],["","Shr<&u64>","gosling::context::HandshakeHandle"],["","Shr<&u8>","gosling::context::HandshakeHandle"],["","Shr<&usize>","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i128> for usize
source§fn shr_assign(&mut self, other: &i128)
Performs the >>=
operation. Read more","ShrAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i16> for usize
source§fn shr_assign(&mut self, other: &i16)
Performs the >>=
operation. Read more","ShrAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i32> for usize
source§fn shr_assign(&mut self, other: &i32)
Performs the >>=
operation. Read more","ShrAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i64> for usize
source§fn shr_assign(&mut self, other: &i64)
Performs the >>=
operation. Read more","ShrAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i8> for usize
source§fn shr_assign(&mut self, other: &i8)
Performs the >>=
operation. Read more","ShrAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&isize> for usize
source§fn shr_assign(&mut self, other: &isize)
Performs the >>=
operation. Read more","ShrAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u128> for usize
source§fn shr_assign(&mut self, other: &u128)
Performs the >>=
operation. Read more","ShrAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u16> for usize
source§fn shr_assign(&mut self, other: &u16)
Performs the >>=
operation. Read more","ShrAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u32> for usize
source§fn shr_assign(&mut self, other: &u32)
Performs the >>=
operation. Read more","ShrAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u64> for usize
source§fn shr_assign(&mut self, other: &u64)
Performs the >>=
operation. Read more","ShrAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u8> for usize
source§fn shr_assign(&mut self, other: &u8)
Performs the >>=
operation. Read more","ShrAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&usize> for usize
source§fn shr_assign(&mut self, other: &usize)
Performs the >>=
operation. Read more","ShrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i128> for usize
source§fn shr_assign(&mut self, other: i128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i16> for usize
source§fn shr_assign(&mut self, other: i16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i32> for usize
source§fn shr_assign(&mut self, other: i32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i64> for usize
source§fn shr_assign(&mut self, other: i64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i8> for usize
source§fn shr_assign(&mut self, other: i8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<isize> for usize
source§fn shr_assign(&mut self, other: isize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u128> for usize
source§fn shr_assign(&mut self, other: u128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u16> for usize
source§fn shr_assign(&mut self, other: u16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u32> for usize
source§fn shr_assign(&mut self, other: u32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u64> for usize
source§fn shr_assign(&mut self, other: u64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u8> for usize
source§fn shr_assign(&mut self, other: u8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign for usize
source§fn shr_assign(&mut self, other: usize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["source§impl SimdElement for usize
","SimdElement","gosling::context::HandshakeHandle"],["1.15.0 (const: unstable) · source§impl<T> SliceIndex<[T]> for usize
The methods index
and index_mut
panic if the index is out of bounds.
\nsource§fn get(self, slice: &[T]) -> Option<&T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a shared reference to the output at this location, if in\nbounds.source§fn get_mut(self, slice: &mut [T]) -> Option<&mut T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable reference to the output at this location, if in\nbounds.source§unsafe fn get_unchecked(self, slice: *const [T]) -> *const T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.source§unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.","SliceIndex<[T]>","gosling::context::HandshakeHandle"],["§impl SmartDisplay for usize
§fn metadata(&self, f: FormatterOptions) -> Metadata<'_, usize>
Compute any information needed to format the value. This must, at a minimum, determine the\nwidth of the value before any padding is added by the formatter. Read more§fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Format the value using the given formatter. This is the same as Display::fmt
. Read more§fn fmt_with_metadata(\n &self,\n f: &mut Formatter<'_>,\n _metadata: Metadata<'_, Self>,\n) -> Result<(), Error>
Format the value using the given formatter and metadata. The formatted output should have\nthe width indicated by the metadata. This is before any padding is added by the\nformatter. Read more","SmartDisplay","gosling::context::HandshakeHandle"],["source§impl Step for usize
source§fn forward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn backward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn forward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn backward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn steps_between(start: &usize, end: &usize) -> Option<usize>
🔬This is a nightly-only experimental API. (step_trait
)","Step","gosling::context::HandshakeHandle"],["","Sub<&'a BigInt>","gosling::context::HandshakeHandle"],["","Sub<&'a BigUint>","gosling::context::HandshakeHandle"],["","Sub<&usize>","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["1.22.0 · source§impl SubAssign<&usize> for usize
source§fn sub_assign(&mut self, other: &usize)
Performs the -=
operation. Read more","SubAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl SubAssign for usize
source§fn sub_assign(&mut self, other: usize)
Performs the -=
operation. Read more","SubAssign","gosling::context::HandshakeHandle"],["","Sum<&'a usize>","gosling::context::HandshakeHandle"],["","Sum","gosling::context::HandshakeHandle"],["","ToBigInt","gosling::context::HandshakeHandle"],["source§impl ToBigUint for usize
source§fn to_biguint(&self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","ToBigUint","gosling::context::HandshakeHandle"],["source§impl ToBytes for usize
§type Bytes = [u8; 8]
source§fn to_be_bytes(&self) -> <usize as ToBytes>::Bytes
Return the memory representation of this number as a byte array in big-endian byte order. Read more","ToBytes","gosling::context::HandshakeHandle"],["source§impl ToPrimitive for usize
source§fn to_isize(&self) -> Option<isize>
Converts the value of self
to an isize
. If the value cannot be\nrepresented by an isize
, then None
is returned.source§fn to_i8(&self) -> Option<i8>
Converts the value of self
to an i8
. If the value cannot be\nrepresented by an i8
, then None
is returned.source§fn to_i16(&self) -> Option<i16>
Converts the value of self
to an i16
. If the value cannot be\nrepresented by an i16
, then None
is returned.source§fn to_i32(&self) -> Option<i32>
Converts the value of self
to an i32
. If the value cannot be\nrepresented by an i32
, then None
is returned.source§fn to_i64(&self) -> Option<i64>
Converts the value of self
to an i64
. If the value cannot be\nrepresented by an i64
, then None
is returned.source§fn to_i128(&self) -> Option<i128>
Converts the value of self
to an i128
. If the value cannot be\nrepresented by an i128
(i64
under the default implementation), then\nNone
is returned. Read moresource§fn to_usize(&self) -> Option<usize>
Converts the value of self
to a usize
. If the value cannot be\nrepresented by a usize
, then None
is returned.source§fn to_u8(&self) -> Option<u8>
Converts the value of self
to a u8
. If the value cannot be\nrepresented by a u8
, then None
is returned.source§fn to_u16(&self) -> Option<u16>
Converts the value of self
to a u16
. If the value cannot be\nrepresented by a u16
, then None
is returned.source§fn to_u32(&self) -> Option<u32>
Converts the value of self
to a u32
. If the value cannot be\nrepresented by a u32
, then None
is returned.source§fn to_u64(&self) -> Option<u64>
Converts the value of self
to a u64
. If the value cannot be\nrepresented by a u64
, then None
is returned.source§fn to_u128(&self) -> Option<u128>
Converts the value of self
to a u128
. If the value cannot be\nrepresented by a u128
(u64
under the default implementation), then\nNone
is returned. Read more","ToPrimitive","gosling::context::HandshakeHandle"],["","ToSql","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","TryFrom>","gosling::context::HandshakeHandle"],["","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i128> for usize
source§fn try_from(u: i128) -> Result<usize, <usize as TryFrom<i128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i16> for usize
source§fn try_from(u: i16) -> Result<usize, <usize as TryFrom<i16>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i32> for usize
source§fn try_from(u: i32) -> Result<usize, <usize as TryFrom<i32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i64> for usize
source§fn try_from(u: i64) -> Result<usize, <usize as TryFrom<i64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i8> for usize
source§fn try_from(u: i8) -> Result<usize, <usize as TryFrom<i8>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<isize> for usize
source§fn try_from(u: isize) -> Result<usize, <usize as TryFrom<isize>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u128> for usize
source§fn try_from(u: u128) -> Result<usize, <usize as TryFrom<u128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u32> for usize
source§fn try_from(value: u32) -> Result<usize, <usize as TryFrom<u32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u64> for usize
source§fn try_from(value: u64) -> Result<usize, <usize as TryFrom<u64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["§impl Unsigned for usize
§fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.§fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
. Read more§fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to n
. If the\nnext power of two is greater than the type’s maximum value, None
is\nreturned, otherwise the power of two is wrapped in Some
.","Unsigned","gosling::context::HandshakeHandle"],["","UpperExp","gosling::context::HandshakeHandle"],["","UpperHex","gosling::context::HandshakeHandle"],["","Value","gosling::context::HandshakeHandle"],["source§impl WrappingAdd for usize
source§fn wrapping_add(&self, v: &usize) -> usize
Wrapping (modular) addition. Computes self + other
, wrapping around at the boundary of\nthe type.","WrappingAdd","gosling::context::HandshakeHandle"],["source§impl WrappingMul for usize
source§fn wrapping_mul(&self, v: &usize) -> usize
Wrapping (modular) multiplication. Computes self * other
, wrapping around at the boundary\nof the type.","WrappingMul","gosling::context::HandshakeHandle"],["source§impl WrappingNeg for usize
source§fn wrapping_neg(&self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type. Read more","WrappingNeg","gosling::context::HandshakeHandle"],["source§impl WrappingShl for usize
","WrappingShl","gosling::context::HandshakeHandle"],["source§impl WrappingShr for usize
","WrappingShr","gosling::context::HandshakeHandle"],["source§impl WrappingSub for usize
source§fn wrapping_sub(&self, v: &usize) -> usize
Wrapping (modular) subtraction. Computes self - other
, wrapping around at the boundary\nof the type.","WrappingSub","gosling::context::HandshakeHandle"],["","WriteHex","gosling::context::HandshakeHandle"],["§impl Writeable for usize
§fn write_to<W>(&self, sink: &mut W) -> Result<(), Error>
Writes a string to the given sink. Errors from the sink are bubbled up.\nThe default implementation delegates to write_to_parts
, and discards any\nPart
annotations.§fn writeable_length_hint(&self) -> LengthHint
Returns a hint for the number of UTF-8 bytes that will be written to the sink. Read more§fn write_to_parts<S>(&self, sink: &mut S) -> Result<(), Error>where\n S: PartsWrite + ?Sized,
Write bytes and Part
annotations to the given sink. Errors from the\nsink are bubbled up. The default implementation delegates to write_to
,\nand doesn’t produce any Part
annotations.§fn write_to_string(&self) -> Cow<'_, str>
Creates a new String
with the data from this Writeable
. Like ToString
,\nbut smaller and faster. Read more§fn writeable_cmp_bytes(&self, other: &[u8]) -> Ordering
Compares the contents of this Writeable
to the given bytes\nwithout allocating a String to hold the Writeable
contents. Read more","Writeable","gosling::context::HandshakeHandle"],["§impl<'a> Yokeable<'a> for usize
§fn transform_owned(self) -> <usize as Yokeable<'a>>::Output
§unsafe fn make(this: <usize as Yokeable<'a>>::Output) -> usize
This method can be used to cast away Self<'a>
’s lifetime. Read more§fn transform_mut<F>(&'a mut self, f: F)
This method must cast self
between &'a mut Self<'static>
and &'a mut Self<'a>
,\nand pass it to f
. Read more","Yokeable<'a>","gosling::context::HandshakeHandle"],["","Zero","gosling::context::HandshakeHandle"],["","ZeroFrom<'a, usize>","gosling::context::HandshakeHandle"],["§impl<'a> ZeroMapKV<'a> for usize
","ZeroMapKV<'a>","gosling::context::HandshakeHandle"],["source§impl usize
1.43.0 · sourcepub const MIN: usize = 0usize
The smallest value that can be represented by this integer type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MIN, 0);
\n1.43.0 · sourcepub const MAX: usize = 18_446_744_073_709_551_615usize
The largest value that can be represented by this integer type\n(264 − 1 on 64-bit targets).
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX, 18446744073709551615);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b01001100usize;\n\nassert_eq!(n.count_ones(), 3);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX.count_zeros(), 0);
\n1.0.0 (const: 1.32.0) · sourcepub const fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of self
.
\nDepending on what you’re doing with the value, you might also be interested in the\nilog2
function which returns a consistent number, even if the type widens.
\n§Examples
\nBasic usage:
\n\nlet n = usize::MAX >> 2;\n\nassert_eq!(n.leading_zeros(), 2);
\n1.0.0 (const: 1.32.0) · sourcepub const fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b0101000usize;\n\nassert_eq!(n.trailing_zeros(), 3);
\n1.46.0 (const: 1.46.0) · sourcepub const fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = !(usize::MAX >> 2);\n\nassert_eq!(n.leading_ones(), 2);
\n1.46.0 (const: 1.46.0) · sourcepub const fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b1010111usize;\n\nassert_eq!(n.trailing_ones(), 3);
\nsourcepub const fn cast_signed(self) -> isize
🔬This is a nightly-only experimental API. (integer_sign_cast
)
Returns the bit pattern of self
reinterpreted as a signed integer of the same size.
\nThis produces the same result as an as
cast, but ensures that the bit-width remains\nthe same.
\n§Examples
\nBasic usage:
\n\n#![feature(integer_sign_cast)]\n\nlet n = usize::MAX;\n\nassert_eq!(n.cast_signed(), -1isize);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
,\nwrapping the truncated bits to the end of the resulting integer.
\nPlease note this isn’t the same operation as the <<
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0xaa00000000006e1usize;\nlet m = 0x6e10aa;\n\nassert_eq!(n.rotate_left(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
,\nwrapping the truncated bits to the beginning of the resulting\ninteger.
\nPlease note this isn’t the same operation as the >>
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0x6e10aausize;\nlet m = 0xaa00000000006e1;\n\nassert_eq!(n.rotate_right(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn swap_bytes(self) -> usize
Reverses the byte order of the integer.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.swap_bytes();\n\nassert_eq!(m, 0x5634129078563412);
\n1.37.0 (const: 1.37.0) · sourcepub const fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit,\nsecond least-significant bit becomes second most-significant bit, etc.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.reverse_bits();\n\nassert_eq!(m, 0x6a2c48091e6a2c48);\nassert_eq!(0, 0usize.reverse_bits());
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_be(x: usize) -> usize
Converts an integer from big endian to the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(usize::from_be(n), n)\n} else {\n assert_eq!(usize::from_be(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_le(x: usize) -> usize
Converts an integer from little endian to the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(usize::from_le(n), n)\n} else {\n assert_eq!(usize::from_le(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_be(self) -> usize
Converts self
to big endian from the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(n.to_be(), n)\n} else {\n assert_eq!(n.to_be(), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_le(self) -> usize
Converts self
to little endian from the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(n.to_le(), n)\n} else {\n assert_eq!(n.to_le(), n.swap_bytes())\n}
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
\nif overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!((usize::MAX - 2).checked_add(1), Some(usize::MAX - 1));\nassert_eq!((usize::MAX - 2).checked_add(3), None);
\nsourcepub const fn strict_add(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer addition. Computes self + rhs
, panicking\nif overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!((usize::MAX - 2).strict_add(1), usize::MAX - 1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add(3);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_add(self, rhs: usize) -> usize
Unchecked integer addition. Computes self + rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_add(y)
is semantically equivalent to calling\nx.
checked_add
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_add
.
\n§Safety
\nThis results in undefined behavior when\nself + rhs > usize::MAX
or self + rhs < usize::MIN
,\ni.e. when checked_add
would return None
.
\n1.66.0 (const: 1.66.0) · sourcepub const fn checked_add_signed(self, rhs: isize) -> Option<usize>
Checked addition with a signed integer. Computes self + rhs
,\nreturning None
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_add_signed(2), Some(3));\nassert_eq!(1usize.checked_add_signed(-2), None);\nassert_eq!((usize::MAX - 2).checked_add_signed(3), None);
\nsourcepub const fn strict_add_signed(self, rhs: isize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict addition with a signed integer. Computes self + rhs
,\npanicking if overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_add_signed(2), 3);
\nThe following panic because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_add_signed(-2);
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add_signed(3);
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_sub(1), Some(0));\nassert_eq!(0usize.checked_sub(1), None);
\nsourcepub const fn strict_sub(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer subtraction. Computes self - rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_sub(1), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0usize.strict_sub(1);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_sub(self, rhs: usize) -> usize
Unchecked integer subtraction. Computes self - rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_sub(y)
is semantically equivalent to calling\nx.
checked_sub
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_sub
.
\nIf you find yourself writing code like this:
\n\nif foo >= bar {\n // SAFETY: just checked it will not overflow\n let diff = unsafe { foo.unchecked_sub(bar) };\n // ... use diff ...\n}
\nConsider changing it to
\n\nif let Some(diff) = foo.checked_sub(bar) {\n // ... use diff ...\n}
\nAs that does exactly the same thing – including telling the optimizer\nthat the subtraction cannot overflow – but avoids needing unsafe
.
\n§Safety
\nThis results in undefined behavior when\nself - rhs > usize::MAX
or self - rhs < usize::MIN
,\ni.e. when checked_sub
would return None
.
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_mul(1), Some(5));\nassert_eq!(usize::MAX.checked_mul(2), None);
\nsourcepub const fn strict_mul(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer multiplication. Computes self * rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(5usize.strict_mul(1), 5);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_mul(2);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_mul(self, rhs: usize) -> usize
Unchecked integer multiplication. Computes self * rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_mul(y)
is semantically equivalent to calling\nx.
checked_mul
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_mul
.
\n§Safety
\nThis results in undefined behavior when\nself * rhs > usize::MAX
or self * rhs < usize::MIN
,\ni.e. when checked_mul
would return None
.
\n1.0.0 (const: 1.52.0) · sourcepub const fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div(2), Some(64));\nassert_eq!(1usize.checked_div(0), None);
\nsourcepub const fn strict_div(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer division. Computes self / rhs
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div_euclid(2), Some(64));\nassert_eq!(1usize.checked_div_euclid(0), None);
\nsourcepub const fn strict_div_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean division. Computes self.div_euclid(rhs)
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div_euclid(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div_euclid(0);
\n1.7.0 (const: 1.52.0) · sourcepub const fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem(2), Some(1));\nassert_eq!(5usize.checked_rem(0), None);
\nsourcepub const fn strict_rem(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer remainder. Computes self % rhs
.\nStrict remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean modulo. Computes self.rem_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem_euclid(2), Some(1));\nassert_eq!(5usize.checked_rem_euclid(0), None);
\nsourcepub const fn strict_rem_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean modulo. Computes self.rem_euclid(rhs)
.\nStrict modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem_euclid(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem_euclid(0);
\n1.67.0 (const: 1.67.0) · sourcepub const fn ilog(self, base: usize) -> u32
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nThis method might not be optimized owing to implementation details;\nilog2
can produce results more efficiently for base 2, and ilog10
\ncan produce results more efficiently for base 10.
\n§Panics
\nThis function will panic if self
is zero, or if base
is less than 2.
\n§Examples
\nassert_eq!(5usize.ilog(5), 1);
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog(self, base: usize) -> Option<u32>
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nReturns None
if the number is zero, or if the base is not at least 2.
\nThis method might not be optimized owing to implementation details;\nchecked_ilog2
can produce results more efficiently for base 2, and\nchecked_ilog10
can produce results more efficiently for base 10.
\n§Examples
\nassert_eq!(5usize.checked_ilog(5), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog2(self) -> Option<u32>
Returns the base 2 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(2usize.checked_ilog2(), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog10(self) -> Option<u32>
Returns the base 10 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(10usize.checked_ilog10(), Some(1));
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_neg(self) -> Option<usize>
Checked negation. Computes -self
, returning None
unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0usize.checked_neg(), Some(0));\nassert_eq!(1usize.checked_neg(), None);
\nsourcepub const fn strict_neg(self) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict negation. Computes -self
, panicking unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0usize.strict_neg(), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_neg();
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x1usize.checked_shl(4), Some(0x10));\nassert_eq!(0x10usize.checked_shl(129), None);
\nsourcepub const fn strict_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift left. Computes self << rhs
, panicking if rhs
is larger\nthan or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x1usize.strict_shl(4), 0x10);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shl(129);
\nsourcepub const unsafe fn unchecked_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift left. Computes self << rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shl
would return None
.
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x10usize.checked_shr(4), Some(0x1));\nassert_eq!(0x10usize.checked_shr(129), None);
\nsourcepub const fn strict_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift right. Computes self >> rhs
, panicking rhs
is\nlarger than or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x10usize.strict_shr(4), 0x1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shr(129);
\nsourcepub const unsafe fn unchecked_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift right. Computes self >> rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shr
would return None
.
\n1.34.0 (const: 1.50.0) · sourcepub const fn checked_pow(self, exp: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_pow(5), Some(32));\nassert_eq!(usize::MAX.checked_pow(2), None);
\nsourcepub const fn strict_pow(self, exp: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict exponentiation. Computes self.pow(exp)
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(2usize.strict_pow(5), 32);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_pow(2);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at\nthe numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_add(1), 101);\nassert_eq!(usize::MAX.saturating_add(127), usize::MAX);
\n1.66.0 (const: 1.66.0) · sourcepub const fn saturating_add_signed(self, rhs: isize) -> usize
Saturating addition with a signed integer. Computes self + rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.saturating_add_signed(2), 3);\nassert_eq!(1usize.saturating_add_signed(-2), 0);\nassert_eq!((usize::MAX - 2).saturating_add_signed(4), usize::MAX);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating\nat the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_sub(27), 73);\nassert_eq!(13usize.saturating_sub(127), 0);
\n1.7.0 (const: 1.47.0) · sourcepub const fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.saturating_mul(10), 20);\nassert_eq!((usize::MAX).saturating_mul(10), usize::MAX);
\n1.58.0 (const: 1.58.0) · sourcepub const fn saturating_div(self, rhs: usize) -> usize
1.34.0 (const: 1.50.0) · sourcepub const fn saturating_pow(self, exp: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(4usize.saturating_pow(3), 64);\nassert_eq!(usize::MAX.saturating_pow(2), usize::MAX);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(200usize.wrapping_add(55), 255);\nassert_eq!(200usize.wrapping_add(usize::MAX), 199);
\n1.66.0 (const: 1.66.0) · sourcepub const fn wrapping_add_signed(self, rhs: isize) -> usize
Wrapping (modular) addition with a signed integer. Computes\nself + rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_add_signed(2), 3);\nassert_eq!(1usize.wrapping_add_signed(-2), usize::MAX);\nassert_eq!((usize::MAX - 2).wrapping_add_signed(4), 1);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_sub(100), 0);\nassert_eq!(100usize.wrapping_sub(usize::MAX), 101);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u8
is used here.
\n\nassert_eq!(10u8.wrapping_mul(12), 120);\nassert_eq!(25u8.wrapping_mul(12), 44);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div(10), 10);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div_euclid(10), 10);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
.\nWrapped remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem(10), 0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean modulo. Computes self.rem_euclid(rhs)
.\nWrapped modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem_euclid(10), 0);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type.
\nSince unsigned types do not have negative equivalents\nall applications of this function will wrap (except for -0
).\nFor values smaller than the corresponding signed type’s maximum\nthe result is the same as casting the corresponding signed value.\nAny larger values are equivalent to MAX + 1 - (val - MAX - 1)
where\nMAX
is the corresponding signed type’s maximum.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0_usize.wrapping_neg(), 0);\nassert_eq!(usize::MAX.wrapping_neg(), 1);\nassert_eq!(13_usize.wrapping_neg(), (!13) + 1);\nassert_eq!(42_usize.wrapping_neg(), !(42 - 1));
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-left; the\nRHS of a wrapping shift-left is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_left
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_shl(7), 128);\nassert_eq!(1usize.wrapping_shl(128), 1);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-right; the\nRHS of a wrapping shift-right is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_right
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.wrapping_shr(7), 1);\nassert_eq!(128usize.wrapping_shr(128), 128);
\n1.34.0 (const: 1.50.0) · sourcepub const fn wrapping_pow(self, exp: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.wrapping_pow(5), 243);\nassert_eq!(3u8.wrapping_pow(6), 217);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_add(self, rhs: usize) -> (usize, bool)
Calculates self
+ rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_add(2), (7, false));\nassert_eq!(usize::MAX.overflowing_add(1), (0, true));
\nsourcepub const fn carrying_add(self, rhs: usize, carry: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
+ rhs
+ carry
and returns a tuple containing\nthe sum and the output carry.
\nPerforms “ternary addition” of two integer operands and a carry-in\nbit, and returns an output integer and a carry-out bit. This allows\nchaining together multiple additions to create a wider addition, and\ncan be useful for bignum addition.
\nThis can be thought of as a 64-bit “full adder”, in the electronics sense.
\nIf the input carry is false, this method is equivalent to\noverflowing_add
, and the output carry is\nequal to the overflow flag. Note that although carry and overflow\nflags are similar for unsigned integers, they are different for\nsigned integers.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 3 MAX (a = 3 × 2^64 + 2^64 - 1)\n// + 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 9 6 (sum = 9 × 2^64 + 6)\n\nlet (a1, a0): (usize, usize) = (3, usize::MAX);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet carry0 = false;\n\nlet (sum0, carry1) = a0.carrying_add(b0, carry0);\nassert_eq!(carry1, true);\nlet (sum1, carry2) = a1.carrying_add(b1, carry1);\nassert_eq!(carry2, false);\n\nassert_eq!((sum1, sum0), (9, 6));
\n1.66.0 (const: 1.66.0) · sourcepub const fn overflowing_add_signed(self, rhs: isize) -> (usize, bool)
Calculates self
+ rhs
with a signed rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.overflowing_add_signed(2), (3, false));\nassert_eq!(1usize.overflowing_add_signed(-2), (usize::MAX, true));\nassert_eq!((usize::MAX - 2).overflowing_add_signed(4), (1, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_sub(self, rhs: usize) -> (usize, bool)
Calculates self
- rhs
\nReturns a tuple of the subtraction along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_sub(2), (3, false));\nassert_eq!(0usize.overflowing_sub(1), (usize::MAX, true));
\nsourcepub const fn borrowing_sub(self, rhs: usize, borrow: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
− rhs
− borrow
and returns a tuple\ncontaining the difference and the output borrow.
\nPerforms “ternary subtraction” by subtracting both an integer\noperand and a borrow-in bit from self
, and returns an output\ninteger and a borrow-out bit. This allows chaining together multiple\nsubtractions to create a wider subtraction, and can be useful for\nbignum subtraction.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 9 6 (a = 9 × 2^64 + 6)\n// - 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 3 MAX (diff = 3 × 2^64 + 2^64 - 1)\n\nlet (a1, a0): (usize, usize) = (9, 6);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet borrow0 = false;\n\nlet (diff0, borrow1) = a0.borrowing_sub(b0, borrow0);\nassert_eq!(borrow1, true);\nlet (diff1, borrow2) = a1.borrowing_sub(b1, borrow1);\nassert_eq!(borrow2, false);\n\nassert_eq!((diff1, diff0), (3, usize::MAX));
\n1.60.0 (const: 1.60.0) · sourcepub const fn abs_diff(self, other: usize) -> usize
Computes the absolute difference between self
and other
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.abs_diff(80), 20usize);\nassert_eq!(100usize.abs_diff(110), 10usize);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_mul(self, rhs: usize) -> (usize, bool)
Calculates the multiplication of self
and rhs
.
\nReturns a tuple of the multiplication along with a boolean\nindicating whether an arithmetic overflow would occur. If an\noverflow would have occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\nassert_eq!(5u32.overflowing_mul(2), (10, false));\nassert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_div(self, rhs: usize) -> (usize, bool)
Calculates the divisor when self
is divided by rhs
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div(2), (2, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.overflowing_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div_euclid(2), (2, false));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_rem(self, rhs: usize) -> (usize, bool)
Calculates the remainder when self
is divided by rhs
.
\nReturns a tuple of the remainder after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem(2), (1, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Calculates the remainder self.rem_euclid(rhs)
as if by Euclidean division.
\nReturns a tuple of the modulo after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this operation\nis exactly equal to self.overflowing_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem_euclid(2), (1, false));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_neg(self) -> (usize, bool)
Negates self in an overflowing fashion.
\nReturns !self + 1
using wrapping operations to return the value\nthat represents the negation of this unsigned value. Note that for\npositive unsigned values overflow always occurs, but negating 0 does\nnot overflow.
\n§Examples
\nBasic usage
\n\nassert_eq!(0usize.overflowing_neg(), (0, false));\nassert_eq!(2usize.overflowing_neg(), (-2i32 as usize, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shl(self, rhs: u32) -> (usize, bool)
Shifts self left by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x1usize.overflowing_shl(4), (0x10, false));\nassert_eq!(0x1usize.overflowing_shl(132), (0x10, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shr(self, rhs: u32) -> (usize, bool)
Shifts self right by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x10usize.overflowing_shr(4), (0x1, false));\nassert_eq!(0x10usize.overflowing_shr(132), (0x1, true));
\n1.34.0 (const: 1.50.0) · sourcepub const fn overflowing_pow(self, exp: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring.
\nReturns a tuple of the exponentiation along with a bool indicating\nwhether an overflow happened.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.overflowing_pow(5), (243, false));\nassert_eq!(3u8.overflowing_pow(6), (217, true));
\n1.0.0 (const: 1.50.0) · sourcepub const fn pow(self, exp: u32) -> usize
Raises self to the power of exp
, using exponentiation by squaring.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.pow(5), 32);
\nsourcepub const fn isqrt(self) -> usize
🔬This is a nightly-only experimental API. (isqrt
)
Returns the square root of the number, rounded down.
\n§Examples
\nBasic usage:
\n\n#![feature(isqrt)]\nassert_eq!(10usize.isqrt(), 3);
\n1.38.0 (const: 1.52.0) · sourcepub const fn div_euclid(self, rhs: usize) -> usize
1.38.0 (const: 1.52.0) · sourcepub const fn rem_euclid(self, rhs: usize) -> usize
Calculates the least remainder of self (mod rhs)
.
\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self % rhs
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(7usize.rem_euclid(4), 3); // or any other integer type
\nsourcepub const fn div_floor(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (int_roundings
)
Calculates the quotient of self
and rhs
, rounding the result towards negative infinity.
\nThis is the same as performing self / rhs
for all unsigned integers.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(int_roundings)]\nassert_eq!(7_usize.div_floor(4), 1);
\n1.73.0 (const: 1.73.0) · sourcepub const fn next_multiple_of(self, rhs: usize) -> usize
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Overflow behavior
\nOn overflow, this function will panic if overflow checks are enabled (default in debug\nmode) and wrap if overflow checks are disabled (default in release mode).
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.next_multiple_of(8), 16);\nassert_eq!(23_usize.next_multiple_of(8), 24);
\n1.73.0 (const: 1.73.0) · sourcepub const fn checked_next_multiple_of(self, rhs: usize) -> Option<usize>
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
. Returns None
if rhs
is zero or the\noperation would result in overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.checked_next_multiple_of(8), Some(16));\nassert_eq!(23_usize.checked_next_multiple_of(8), Some(24));\nassert_eq!(1_usize.checked_next_multiple_of(0), None);\nassert_eq!(usize::MAX.checked_next_multiple_of(2), None);
\n1.0.0 (const: 1.32.0) · sourcepub const fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.
\n§Examples
\nBasic usage:
\n\nassert!(16usize.is_power_of_two());\nassert!(!10usize.is_power_of_two());
\n1.0.0 (const: 1.50.0) · sourcepub const fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
.
\nWhen return value overflows (i.e., self > (1 << (N-1))
for type\nuN
), it panics in debug mode and the return value is wrapped to 0 in\nrelease mode (the only situation in which this method can return 0).
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.next_power_of_two(), 2);\nassert_eq!(3usize.next_power_of_two(), 4);\nassert_eq!(0usize.next_power_of_two(), 1);
\n1.0.0 (const: 1.50.0) · sourcepub const fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to self
. If\nthe next power of two is greater than the type’s maximum value,\nNone
is returned, otherwise the power of two is wrapped in Some
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_next_power_of_two(), Some(2));\nassert_eq!(3usize.checked_next_power_of_two(), Some(4));\nassert_eq!(usize::MAX.checked_next_power_of_two(), None);
\nsourcepub const fn wrapping_next_power_of_two(self) -> usize
🔬This is a nightly-only experimental API. (wrapping_next_power_of_two
)
Returns the smallest power of two greater than or equal to n
. If\nthe next power of two is greater than the type’s maximum value,\nthe return value is wrapped to 0
.
\n§Examples
\nBasic usage:
\n\n#![feature(wrapping_next_power_of_two)]\n\nassert_eq!(2usize.wrapping_next_power_of_two(), 2);\nassert_eq!(3usize.wrapping_next_power_of_two(), 4);\nassert_eq!(usize::MAX.wrapping_next_power_of_two(), 0);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_be_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nbig-endian (network) byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_be_bytes();\nassert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_le_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nlittle-endian byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_le_bytes();\nassert_eq!(bytes, [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_ne_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nnative byte order.
\nAs the target platform’s native endianness is used, portable code\nshould use to_be_bytes
or to_le_bytes
, as appropriate,\ninstead.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_ne_bytes();\nassert_eq!(\n bytes,\n if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n } else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n }\n);
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_be_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in big endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_be_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_be_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_le_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in little endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_le_bytes([0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_le_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_le_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_ne_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its memory representation\nas a byte array in native endianness.
\nAs the target platform’s native endianness is used, portable code\nlikely wants to use from_be_bytes
or from_le_bytes
, as\nappropriate instead.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_ne_bytes(if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n} else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n});\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_ne_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_ne_bytes(int_bytes.try_into().unwrap())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn min_value() -> usize
👎Deprecating in a future version: replaced by the MIN
associated constant on this type
New code should prefer to use\nusize::MIN
instead.
\nReturns the smallest value that can be represented by this integer type.
\n1.0.0 (const: 1.32.0) · sourcepub const fn max_value() -> usize
👎Deprecating in a future version: replaced by the MAX
associated constant on this type
New code should prefer to use\nusize::MAX
instead.
\nReturns the largest value that can be represented by this integer type.
\nsourcepub const fn widening_mul(self, rhs: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the complete product self * rhs
without the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nIf you also need to add a carry to the wide result, then you want\nSelf::carrying_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.widening_mul(2), (10, 0));\nassert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));
\nsourcepub const fn carrying_mul(self, rhs: usize, carry: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the “full multiplication” self * rhs + carry
\nwithout the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nPerforms “long multiplication” which takes in an extra amount to add, and may return an\nadditional amount of overflow. This allows for chaining together multiple\nmultiplications to create “big integers” which represent larger values.
\nIf you don’t need the carry
, then you can use Self::widening_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.carrying_mul(2, 0), (10, 0));\nassert_eq!(5u32.carrying_mul(2, 10), (20, 0));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));\nassert_eq!(usize::MAX.carrying_mul(usize::MAX, usize::MAX), (0, usize::MAX));
\nThis is the core operation needed for scalar multiplication when\nimplementing it for wider-than-native types.
\n\n#![feature(bigint_helper_methods)]\nfn scalar_mul_eq(little_endian_digits: &mut Vec<u16>, multiplicand: u16) {\n let mut carry = 0;\n for d in little_endian_digits.iter_mut() {\n (*d, carry) = d.carrying_mul(multiplicand, carry);\n }\n if carry != 0 {\n little_endian_digits.push(carry);\n }\n}\n\nlet mut v = vec![10, 20];\nscalar_mul_eq(&mut v, 3);\nassert_eq!(v, [30, 60]);\n\nassert_eq!(0x87654321_u64 * 0xFEED, 0x86D3D159E38D);\nlet mut v = vec![0x4321, 0x8765];\nscalar_mul_eq(&mut v, 0xFEED);\nassert_eq!(v, [0xE38D, 0xD159, 0x86D3]);
\nIf carry
is zero, this is similar to overflowing_mul
,\nexcept that it gives the value of the overflow instead of just whether one happened:
\n\n#![feature(bigint_helper_methods)]\nlet r = u8::carrying_mul(7, 13, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));\nlet r = u8::carrying_mul(13, 42, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(13, 42));
\nThe value of the first field in the returned tuple matches what you’d get\nby combining the wrapping_mul
and\nwrapping_add
methods:
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(\n 789_u16.carrying_mul(456, 123).0,\n 789_u16.wrapping_mul(456).wrapping_add(123),\n);
\nsourcepub const fn midpoint(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (num_midpoint
)
Calculates the middle point of self
and rhs
.
\nmidpoint(a, b)
is (a + b) >> 1
as if it were performed in a\nsufficiently-large signed integral type. This implies that the result is\nalways rounded towards negative infinity and that no overflow will ever occur.
\n§Examples
\n#![feature(num_midpoint)]\nassert_eq!(0usize.midpoint(4), 2);\nassert_eq!(1usize.midpoint(4), 2);
\n",0,"gosling::context::HandshakeHandle"],["source§impl usize
1.0.0 (const: unstable) · sourcepub fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer.
\nThe string is expected to be an optional +
sign\nfollowed by digits.\nLeading and trailing whitespace represent an error.\nDigits are a subset of these characters, depending on radix
:
\n\n0-9
\na-z
\nA-Z
\n
\n§Panics
\nThis function panics if radix
is not in the range from 2 to 36.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::from_str_radix(\"A\", 16), Ok(10));
\n",0,"gosling::context::HandshakeHandle"],["§impl AtLeast16 for usize
","AtLeast16","gosling::context::HandshakeHandle"],["§impl AtLeast32 for usize
","AtLeast32","gosling::context::HandshakeHandle"],["§impl AtLeast64 for usize
","AtLeast64","gosling::context::HandshakeHandle"],["§impl AtLeast8 for usize
","AtLeast8","gosling::context::HandshakeHandle"],["§impl AtMost128 for usize
","AtMost128","gosling::context::HandshakeHandle"],["§impl AtMost64 for usize
","AtMost64","gosling::context::HandshakeHandle"],["§impl BitOps for usize
","BitOps","gosling::context::HandshakeHandle"],["source§impl ConstParamTy for usize
","ConstParamTy","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Copy for usize
","Copy","gosling::context::HandshakeHandle"],["§impl DefaultIsZeroes for usize
","DefaultIsZeroes","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Eq for usize
","Eq","gosling::context::HandshakeHandle"],["§impl ExtendTarget<usize> for usize
","ExtendTarget","gosling::context::HandshakeHandle"],["source§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["source§impl Integer for usize
","Integer","gosling::context::HandshakeHandle"],["§impl Is64 for usize
","Is64","gosling::context::HandshakeHandle"],["§impl NotAutoValue for usize
","NotAutoValue","gosling::context::HandshakeHandle"],["§impl NumericOps for usize
","NumericOps","gosling::context::HandshakeHandle"],["source§impl SimdCast for usize
","SimdCast","gosling::context::HandshakeHandle"],["source§impl StructuralPartialEq for usize
","StructuralPartialEq","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u16> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u8> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<usize> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["source§impl TrustedStep for usize
","TrustedStep","gosling::context::HandshakeHandle"],["§impl Uint for usize
","Uint","gosling::context::HandshakeHandle"],["source§impl Unsigned for usize
","Unsigned","gosling::context::HandshakeHandle"],["source§impl Weight for usize
","Weight","gosling::context::HandshakeHandle"],["source§impl ZeroablePrimitive for usize
","ZeroablePrimitive","gosling::context::HandshakeHandle"]],
-"tor_interface":[["","Accumulate","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Add<&usize>","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","tor_interface::tor_provider::CircuitToken"],["","AsAny","tor_interface::tor_provider::CircuitToken"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["","Binary","tor_interface::tor_provider::CircuitToken"],["","BitAnd<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitAnd","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","tor_interface::tor_provider::CircuitToken"],["","BitOr<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitOr","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","tor_interface::tor_provider::CircuitToken"],["","BitRegister","tor_interface::tor_provider::CircuitToken"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","tor_interface::tor_provider::CircuitToken"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","tor_interface::tor_provider::CircuitToken"],["","BitXor<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitXor","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","tor_interface::tor_provider::CircuitToken"],["","Bits","tor_interface::tor_provider::CircuitToken"],["","Bounded","tor_interface::tor_provider::CircuitToken"],["","CastSigned","tor_interface::tor_provider::CircuitToken"],["","CastUnsigned","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedAdd for usize
","CheckedAdd","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedDiv for usize
","CheckedDiv","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedMul for usize
","CheckedMul","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedNeg for usize
","CheckedNeg","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedRem for usize
","CheckedRem","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShl for usize
","CheckedShl","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShr for usize
","CheckedShr","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedSub for usize
","CheckedSub","tor_interface::tor_provider::CircuitToken"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","tor_interface::tor_provider::CircuitToken"],["","Clone","tor_interface::tor_provider::CircuitToken"],["","ConstOne","tor_interface::tor_provider::CircuitToken"],["","ConstZero","tor_interface::tor_provider::CircuitToken"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","tor_interface::tor_provider::CircuitToken"],["","Debug","tor_interface::tor_provider::CircuitToken"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","tor_interface::tor_provider::CircuitToken"],["","Default","tor_interface::tor_provider::CircuitToken"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","tor_interface::tor_provider::CircuitToken"],["","Display","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Div<&usize>","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","tor_interface::tor_provider::CircuitToken"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","tor_interface::tor_provider::CircuitToken"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","tor_interface::tor_provider::CircuitToken"],["","FmtConst","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","tor_interface::tor_provider::CircuitToken"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","tor_interface::tor_provider::CircuitToken"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","tor_interface::tor_provider::CircuitToken"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","tor_interface::tor_provider::CircuitToken"],["","FromStr","tor_interface::tor_provider::CircuitToken"],["","FromZeroes","tor_interface::tor_provider::CircuitToken"],["","Fundamental","tor_interface::tor_provider::CircuitToken"],["","Hash","tor_interface::tor_provider::CircuitToken"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","tor_interface::tor_provider::CircuitToken"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","tor_interface::tor_provider::CircuitToken"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","tor_interface::tor_provider::CircuitToken"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","tor_interface::tor_provider::CircuitToken"],["","LowerExp","tor_interface::tor_provider::CircuitToken"],["","LowerHex","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Mul<&usize>","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","MulAdd","tor_interface::tor_provider::CircuitToken"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","tor_interface::tor_provider::CircuitToken"],["","Not","tor_interface::tor_provider::CircuitToken"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","tor_interface::tor_provider::CircuitToken"],["","NumCast","tor_interface::tor_provider::CircuitToken"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","tor_interface::tor_provider::CircuitToken"],["","Octal","tor_interface::tor_provider::CircuitToken"],["","One","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Ord for usize
","Ord","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingAdd for usize
","OverflowingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingMul for usize
","OverflowingMul","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingSub for usize
","OverflowingSub","tor_interface::tor_provider::CircuitToken"],["","ParseHex","tor_interface::tor_provider::CircuitToken"],["source§impl PartialEq<Value> for usize
","PartialEq","tor_interface::tor_provider::CircuitToken"],["","PartialEq","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","tor_interface::tor_provider::CircuitToken"],["","PhfBorrow","tor_interface::tor_provider::CircuitToken"],["","PhfHash","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u16>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u32>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u8>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","tor_interface::tor_provider::CircuitToken"],["","Product<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Product","tor_interface::tor_provider::CircuitToken"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Rem<&usize>","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","tor_interface::tor_provider::CircuitToken"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["source§impl Roots for usize
","Roots","tor_interface::tor_provider::CircuitToken"],["","RowIndex","tor_interface::tor_provider::CircuitToken"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","tor_interface::tor_provider::CircuitToken"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","tor_interface::tor_provider::CircuitToken"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","tor_interface::tor_provider::CircuitToken"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","tor_interface::tor_provider::CircuitToken"],["","Shl<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["","Shr<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["
Expand description
MockTorClient
-specific error type
ClientNotBootstrapped()
ClientAlreadyBootstrapped()
OnionServiceNotFound(OnionAddr)
OnionServiceNotPublished(OnionAddr)
OnionServiceRequiresOnionAuth()
OnionServiceAuthInvalid()
TcpListenerBindFailed(Error)
TcpListenerLocalAddrFailed(Error)
ConnectFailed(TargetAddr)
NotImplemented()
source§impl Error for Error
impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Variants§
ClientNotBootstrapped()
ClientAlreadyBootstrapped()
OnionServiceNotFound(OnionAddr)
OnionServiceNotPublished(OnionAddr)
OnionServiceRequiresOnionAuth()
OnionServiceAuthInvalid()
TcpListenerBindFailed(Error)
TcpListenerLocalAddrFailed(Error)
ConnectFailed(TargetAddr)
NotImplemented()
Trait Implementations§
source§impl Error for Error
impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Variants§
Socks4(Socks4ProxyConfig)
A SOCKS4 proxy
Socks5(Socks5ProxyConfig)
A SOCKS5 proxy
Https(HttpsProxyConfig)
An HTTP CONNECT proxy
-Trait Implementations§
source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
source§fn clone(&self) -> ProxyConfig
fn clone(&self) -> ProxyConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ProxyConfig
impl Debug for ProxyConfig
source§impl From<HttpsProxyConfig> for ProxyConfig
impl From<HttpsProxyConfig> for ProxyConfig
source§fn from(config: HttpsProxyConfig) -> Self
fn from(config: HttpsProxyConfig) -> Self
source§impl From<Socks4ProxyConfig> for ProxyConfig
impl From<Socks4ProxyConfig> for ProxyConfig
source§fn from(config: Socks4ProxyConfig) -> Self
fn from(config: Socks4ProxyConfig) -> Self
source§impl From<Socks5ProxyConfig> for ProxyConfig
impl From<Socks5ProxyConfig> for ProxyConfig
source§fn from(config: Socks5ProxyConfig) -> Self
fn from(config: Socks5ProxyConfig) -> Self
Auto Trait Implementations§
impl Freeze for ProxyConfig
impl RefUnwindSafe for ProxyConfig
impl Send for ProxyConfig
impl Sync for ProxyConfig
impl Unpin for ProxyConfig
impl UnwindSafe for ProxyConfig
Blanket Implementations§
Trait Implementations§
source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
source§fn clone(&self) -> ProxyConfig
fn clone(&self) -> ProxyConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ProxyConfig
impl Debug for ProxyConfig
source§impl From<HttpsProxyConfig> for ProxyConfig
impl From<HttpsProxyConfig> for ProxyConfig
source§fn from(config: HttpsProxyConfig) -> Self
fn from(config: HttpsProxyConfig) -> Self
source§impl From<Socks4ProxyConfig> for ProxyConfig
impl From<Socks4ProxyConfig> for ProxyConfig
source§fn from(config: Socks4ProxyConfig) -> Self
fn from(config: Socks4ProxyConfig) -> Self
source§impl From<Socks5ProxyConfig> for ProxyConfig
impl From<Socks5ProxyConfig> for ProxyConfig
source§fn from(config: Socks5ProxyConfig) -> Self
fn from(config: Socks5ProxyConfig) -> Self
Auto Trait Implementations§
impl Freeze for ProxyConfig
impl RefUnwindSafe for ProxyConfig
impl Send for ProxyConfig
impl Sync for ProxyConfig
impl Unpin for ProxyConfig
impl UnwindSafe for ProxyConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
fn implicit(
diff --git a/crates/tor_interface/proxy/enum.ProxyConfigError.html b/crates/tor_interface/proxy/enum.ProxyConfigError.html
index 2e60ba2f..b61a46da 100644
--- a/crates/tor_interface/proxy/enum.ProxyConfigError.html
+++ b/crates/tor_interface/proxy/enum.ProxyConfigError.html
@@ -2,7 +2,7 @@
Generic(String),
}Expand description
Error type for the proxy module
Variants§
Trait Implementations§
source§impl Debug for ProxyConfigError
source§impl Display for ProxyConfigError
source§impl Error for ProxyConfigError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for ProxyConfigError
§impl RefUnwindSafe for ProxyConfigError
§impl Send for ProxyConfigError
§impl Sync for ProxyConfigError
§impl Unpin for ProxyConfigError
§impl UnwindSafe for ProxyConfigError
Blanket Implementations§
Trait Implementations§
source§impl Debug for ProxyConfigError
source§impl Display for ProxyConfigError
source§impl Error for ProxyConfigError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()Auto Trait Implementations§
§impl Freeze for ProxyConfigError
§impl RefUnwindSafe for ProxyConfigError
§impl Send for ProxyConfigError
§impl Sync for ProxyConfigError
§impl Unpin for ProxyConfigError
§impl UnwindSafe for ProxyConfigError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/crates/tor_interface/tor_crypto/enum.SignBit.html b/crates/tor_interface/tor_crypto/enum.SignBit.html
index c7f445ee..46527642 100644
--- a/crates/tor_interface/tor_crypto/enum.SignBit.html
+++ b/crates/tor_interface/tor_crypto/enum.SignBit.html
@@ -2,7 +2,7 @@
Zero,
One,
}Expand description
An enum representing a single bit
-Variants§
Trait Implementations§
source§impl Copy for SignBit
Auto Trait Implementations§
§impl Freeze for SignBit
§impl RefUnwindSafe for SignBit
§impl Send for SignBit
§impl Sync for SignBit
§impl Unpin for SignBit
§impl UnwindSafe for SignBit
Blanket Implementations§
Variants§
Trait Implementations§
source§impl Copy for SignBit
Auto Trait Implementations§
§impl Freeze for SignBit
§impl RefUnwindSafe for SignBit
§impl Send for SignBit
§impl Sync for SignBit
§impl Unpin for SignBit
§impl UnwindSafe for SignBit
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html b/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html
index 415df0b0..d7f04cb7 100644
--- a/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html
+++ b/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html
@@ -16,7 +16,7 @@
sourcepub fn from_private_key(private_key: &Ed25519PrivateKey) -> V3OnionServiceId
Create a V3OnionServiceId
from an Ed25519PrivateKey
.
Trait Implementations§
source§impl Clone for V3OnionServiceId
source§fn clone(&self) -> V3OnionServiceId
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for V3OnionServiceId
source§impl Display for V3OnionServiceId
Trait Implementations§
source§impl Clone for V3OnionServiceId
source§fn clone(&self) -> V3OnionServiceId
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for V3OnionServiceId
source§impl Display for V3OnionServiceId
source§impl Hash for V3OnionServiceId
source§impl Ord for V3OnionServiceId
source§fn cmp(&self, other: &V3OnionServiceId) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/tor_interface/tor_provider/enum.OnionAddr.html b/crates/tor_interface/tor_provider/enum.OnionAddr.html
index 330e8dc7..212631b0 100644
--- a/crates/tor_interface/tor_provider/enum.OnionAddr.html
+++ b/crates/tor_interface/tor_provider/enum.OnionAddr.html
@@ -1,7 +1,7 @@
OnionAddr in tor_interface::tor_provider - Rust Enum tor_interface::tor_provider::OnionAddr
source · pub enum OnionAddr {
V3(OnionAddrV3),
}
Expand description
An onion service address analog to std::net::SocketAddr
-Variants§
§V3(OnionAddrV3)
Trait Implementations§
source§impl Hash for OnionAddr
1.3.0 · source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+
Variants§
§V3(OnionAddrV3)
Trait Implementations§
source§impl Ord for OnionAddr
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/tor_interface/tor_provider/struct.DomainAddr.html b/crates/tor_interface/tor_provider/struct.DomainAddr.html
index 9093e21e..c541ef98 100644
--- a/crates/tor_interface/tor_provider/struct.DomainAddr.html
+++ b/crates/tor_interface/tor_provider/struct.DomainAddr.html
@@ -3,7 +3,7 @@
Implementations§
Trait Implementations§
source§impl Clone for DomainAddr
source§fn clone(&self) -> DomainAddr
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for DomainAddr
source§impl Display for DomainAddr
source§impl FromStr for DomainAddr
Trait Implementations§
source§impl Clone for DomainAddr
source§fn clone(&self) -> DomainAddr
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for DomainAddr
source§impl Display for DomainAddr
source§impl FromStr for DomainAddr
source§impl Hash for DomainAddr
source§impl Ord for DomainAddr
source§fn cmp(&self, other: &DomainAddr) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/type.impl/std/primitive.usize.js b/crates/type.impl/std/primitive.usize.js
index da014e4e..ef01c053 100644
--- a/crates/type.impl/std/primitive.usize.js
+++ b/crates/type.impl/std/primitive.usize.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
-"gosling":[["","Accumulate","gosling::context::HandshakeHandle"],["","Add<&'a BigInt>","gosling::context::HandshakeHandle"],["","Add<&'a BigUint>","gosling::context::HandshakeHandle"],["","Add<&usize>","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","gosling::context::HandshakeHandle"],["","AsAny","gosling::context::HandshakeHandle"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["","Binary","gosling::context::HandshakeHandle"],["","BitAnd<&usize>","gosling::context::HandshakeHandle"],["","BitAnd","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","gosling::context::HandshakeHandle"],["","BitOr<&usize>","gosling::context::HandshakeHandle"],["","BitOr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","gosling::context::HandshakeHandle"],["","BitRegister","gosling::context::HandshakeHandle"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","gosling::context::HandshakeHandle"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","gosling::context::HandshakeHandle"],["","BitXor<&usize>","gosling::context::HandshakeHandle"],["","BitXor","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","gosling::context::HandshakeHandle"],["","Bits","gosling::context::HandshakeHandle"],["","Bounded","gosling::context::HandshakeHandle"],["","CastSigned","gosling::context::HandshakeHandle"],["","CastUnsigned","gosling::context::HandshakeHandle"],["source§impl CheckedAdd for usize
","CheckedAdd","gosling::context::HandshakeHandle"],["source§impl CheckedDiv for usize
","CheckedDiv","gosling::context::HandshakeHandle"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","gosling::context::HandshakeHandle"],["source§impl CheckedMul for usize
","CheckedMul","gosling::context::HandshakeHandle"],["source§impl CheckedNeg for usize
","CheckedNeg","gosling::context::HandshakeHandle"],["source§impl CheckedRem for usize
","CheckedRem","gosling::context::HandshakeHandle"],["source§impl CheckedShl for usize
","CheckedShl","gosling::context::HandshakeHandle"],["source§impl CheckedShr for usize
","CheckedShr","gosling::context::HandshakeHandle"],["source§impl CheckedSub for usize
","CheckedSub","gosling::context::HandshakeHandle"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","gosling::context::HandshakeHandle"],["","Clone","gosling::context::HandshakeHandle"],["","ConstOne","gosling::context::HandshakeHandle"],["","ConstZero","gosling::context::HandshakeHandle"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","gosling::context::HandshakeHandle"],["","Debug","gosling::context::HandshakeHandle"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","gosling::context::HandshakeHandle"],["","Default","gosling::context::HandshakeHandle"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","gosling::context::HandshakeHandle"],["","Display","gosling::context::HandshakeHandle"],["","Div<&'a BigInt>","gosling::context::HandshakeHandle"],["","Div<&'a BigUint>","gosling::context::HandshakeHandle"],["","Div<&usize>","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","gosling::context::HandshakeHandle"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","gosling::context::HandshakeHandle"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","gosling::context::HandshakeHandle"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","gosling::context::HandshakeHandle"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","gosling::context::HandshakeHandle"],["","FmtConst","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","gosling::context::HandshakeHandle"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","gosling::context::HandshakeHandle"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","gosling::context::HandshakeHandle"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","gosling::context::HandshakeHandle"],["","FromStr","gosling::context::HandshakeHandle"],["","FromZeroes","gosling::context::HandshakeHandle"],["","Fundamental","gosling::context::HandshakeHandle"],["","Hash","gosling::context::HandshakeHandle"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","gosling::context::HandshakeHandle"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","gosling::context::HandshakeHandle"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","gosling::context::HandshakeHandle"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","gosling::context::HandshakeHandle"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","gosling::context::HandshakeHandle"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","gosling::context::HandshakeHandle"],["","LowerExp","gosling::context::HandshakeHandle"],["","LowerHex","gosling::context::HandshakeHandle"],["","Mul<&'a BigInt>","gosling::context::HandshakeHandle"],["","Mul<&'a BigUint>","gosling::context::HandshakeHandle"],["","Mul<&usize>","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","MulAdd","gosling::context::HandshakeHandle"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","gosling::context::HandshakeHandle"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","gosling::context::HandshakeHandle"],["","Not","gosling::context::HandshakeHandle"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","gosling::context::HandshakeHandle"],["","NumCast","gosling::context::HandshakeHandle"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","gosling::context::HandshakeHandle"],["","Octal","gosling::context::HandshakeHandle"],["","One","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Ord for usize
","Ord","gosling::context::HandshakeHandle"],["source§impl OverflowingAdd for usize
","OverflowingAdd","gosling::context::HandshakeHandle"],["source§impl OverflowingMul for usize
","OverflowingMul","gosling::context::HandshakeHandle"],["source§impl OverflowingSub for usize
","OverflowingSub","gosling::context::HandshakeHandle"],["","ParseHex","gosling::context::HandshakeHandle"],["source§impl PartialEq<Value> for usize
","PartialEq","gosling::context::HandshakeHandle"],["","PartialEq","gosling::context::HandshakeHandle"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","gosling::context::HandshakeHandle"],["","PhfBorrow","gosling::context::HandshakeHandle"],["","PhfHash","gosling::context::HandshakeHandle"],["","Pow<&'a u16>","gosling::context::HandshakeHandle"],["","Pow<&'a u32>","gosling::context::HandshakeHandle"],["","Pow<&'a u8>","gosling::context::HandshakeHandle"],["","Pow<&'a usize>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","gosling::context::HandshakeHandle"],["","Product<&'a usize>","gosling::context::HandshakeHandle"],["","Product","gosling::context::HandshakeHandle"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","gosling::context::HandshakeHandle"],["","Rem<&'a BigInt>","gosling::context::HandshakeHandle"],["","Rem<&'a BigUint>","gosling::context::HandshakeHandle"],["","Rem<&usize>","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","gosling::context::HandshakeHandle"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","gosling::context::HandshakeHandle"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["source§impl Roots for usize
","Roots","gosling::context::HandshakeHandle"],["","RowIndex","gosling::context::HandshakeHandle"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","gosling::context::HandshakeHandle"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","gosling::context::HandshakeHandle"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","gosling::context::HandshakeHandle"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","gosling::context::HandshakeHandle"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","gosling::context::HandshakeHandle"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","gosling::context::HandshakeHandle"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","gosling::context::HandshakeHandle"],["","Shl<&i128>","gosling::context::HandshakeHandle"],["","Shl<&i16>","gosling::context::HandshakeHandle"],["","Shl<&i32>","gosling::context::HandshakeHandle"],["","Shl<&i64>","gosling::context::HandshakeHandle"],["","Shl<&i8>","gosling::context::HandshakeHandle"],["","Shl<&isize>","gosling::context::HandshakeHandle"],["","Shl<&u128>","gosling::context::HandshakeHandle"],["","Shl<&u16>","gosling::context::HandshakeHandle"],["","Shl<&u32>","gosling::context::HandshakeHandle"],["","Shl<&u64>","gosling::context::HandshakeHandle"],["","Shl<&u8>","gosling::context::HandshakeHandle"],["","Shl<&usize>","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["","Shr<&i128>","gosling::context::HandshakeHandle"],["","Shr<&i16>","gosling::context::HandshakeHandle"],["","Shr<&i32>","gosling::context::HandshakeHandle"],["","Shr<&i64>","gosling::context::HandshakeHandle"],["","Shr<&i8>","gosling::context::HandshakeHandle"],["","Shr<&isize>","gosling::context::HandshakeHandle"],["","Shr<&u128>","gosling::context::HandshakeHandle"],["","Shr<&u16>","gosling::context::HandshakeHandle"],["","Shr<&u32>","gosling::context::HandshakeHandle"],["","Shr<&u64>","gosling::context::HandshakeHandle"],["","Shr<&u8>","gosling::context::HandshakeHandle"],["","Shr<&usize>","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i128> for usize
source§fn shr_assign(&mut self, other: &i128)
Performs the >>=
operation. Read more","ShrAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i16> for usize
source§fn shr_assign(&mut self, other: &i16)
Performs the >>=
operation. Read more","ShrAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i32> for usize
source§fn shr_assign(&mut self, other: &i32)
Performs the >>=
operation. Read more","ShrAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i64> for usize
source§fn shr_assign(&mut self, other: &i64)
Performs the >>=
operation. Read more","ShrAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i8> for usize
source§fn shr_assign(&mut self, other: &i8)
Performs the >>=
operation. Read more","ShrAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&isize> for usize
source§fn shr_assign(&mut self, other: &isize)
Performs the >>=
operation. Read more","ShrAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u128> for usize
source§fn shr_assign(&mut self, other: &u128)
Performs the >>=
operation. Read more","ShrAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u16> for usize
source§fn shr_assign(&mut self, other: &u16)
Performs the >>=
operation. Read more","ShrAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u32> for usize
source§fn shr_assign(&mut self, other: &u32)
Performs the >>=
operation. Read more","ShrAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u64> for usize
source§fn shr_assign(&mut self, other: &u64)
Performs the >>=
operation. Read more","ShrAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u8> for usize
source§fn shr_assign(&mut self, other: &u8)
Performs the >>=
operation. Read more","ShrAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&usize> for usize
source§fn shr_assign(&mut self, other: &usize)
Performs the >>=
operation. Read more","ShrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i128> for usize
source§fn shr_assign(&mut self, other: i128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i16> for usize
source§fn shr_assign(&mut self, other: i16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i32> for usize
source§fn shr_assign(&mut self, other: i32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i64> for usize
source§fn shr_assign(&mut self, other: i64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i8> for usize
source§fn shr_assign(&mut self, other: i8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<isize> for usize
source§fn shr_assign(&mut self, other: isize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u128> for usize
source§fn shr_assign(&mut self, other: u128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u16> for usize
source§fn shr_assign(&mut self, other: u16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u32> for usize
source§fn shr_assign(&mut self, other: u32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u64> for usize
source§fn shr_assign(&mut self, other: u64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u8> for usize
source§fn shr_assign(&mut self, other: u8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign for usize
source§fn shr_assign(&mut self, other: usize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["source§impl SimdElement for usize
","SimdElement","gosling::context::HandshakeHandle"],["1.15.0 (const: unstable) · source§impl<T> SliceIndex<[T]> for usize
The methods index
and index_mut
panic if the index is out of bounds.
\nsource§fn get(self, slice: &[T]) -> Option<&T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a shared reference to the output at this location, if in\nbounds.source§fn get_mut(self, slice: &mut [T]) -> Option<&mut T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable reference to the output at this location, if in\nbounds.source§unsafe fn get_unchecked(self, slice: *const [T]) -> *const T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.source§unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.","SliceIndex<[T]>","gosling::context::HandshakeHandle"],["§impl SmartDisplay for usize
§fn metadata(&self, f: FormatterOptions) -> Metadata<'_, usize>
Compute any information needed to format the value. This must, at a minimum, determine the\nwidth of the value before any padding is added by the formatter. Read more§fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Format the value using the given formatter. This is the same as Display::fmt
. Read more§fn fmt_with_metadata(\n &self,\n f: &mut Formatter<'_>,\n _metadata: Metadata<'_, Self>,\n) -> Result<(), Error>
Format the value using the given formatter and metadata. The formatted output should have\nthe width indicated by the metadata. This is before any padding is added by the\nformatter. Read more","SmartDisplay","gosling::context::HandshakeHandle"],["source§impl Step for usize
source§fn forward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn backward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn forward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn backward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn steps_between(start: &usize, end: &usize) -> Option<usize>
🔬This is a nightly-only experimental API. (step_trait
)","Step","gosling::context::HandshakeHandle"],["","Sub<&'a BigInt>","gosling::context::HandshakeHandle"],["","Sub<&'a BigUint>","gosling::context::HandshakeHandle"],["","Sub<&usize>","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["1.22.0 · source§impl SubAssign<&usize> for usize
source§fn sub_assign(&mut self, other: &usize)
Performs the -=
operation. Read more","SubAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl SubAssign for usize
source§fn sub_assign(&mut self, other: usize)
Performs the -=
operation. Read more","SubAssign","gosling::context::HandshakeHandle"],["","Sum<&'a usize>","gosling::context::HandshakeHandle"],["","Sum","gosling::context::HandshakeHandle"],["","ToBigInt","gosling::context::HandshakeHandle"],["source§impl ToBigUint for usize
source§fn to_biguint(&self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","ToBigUint","gosling::context::HandshakeHandle"],["source§impl ToBytes for usize
§type Bytes = [u8; 8]
source§fn to_be_bytes(&self) -> <usize as ToBytes>::Bytes
Return the memory representation of this number as a byte array in big-endian byte order. Read more","ToBytes","gosling::context::HandshakeHandle"],["source§impl ToPrimitive for usize
source§fn to_isize(&self) -> Option<isize>
Converts the value of self
to an isize
. If the value cannot be\nrepresented by an isize
, then None
is returned.source§fn to_i8(&self) -> Option<i8>
Converts the value of self
to an i8
. If the value cannot be\nrepresented by an i8
, then None
is returned.source§fn to_i16(&self) -> Option<i16>
Converts the value of self
to an i16
. If the value cannot be\nrepresented by an i16
, then None
is returned.source§fn to_i32(&self) -> Option<i32>
Converts the value of self
to an i32
. If the value cannot be\nrepresented by an i32
, then None
is returned.source§fn to_i64(&self) -> Option<i64>
Converts the value of self
to an i64
. If the value cannot be\nrepresented by an i64
, then None
is returned.source§fn to_i128(&self) -> Option<i128>
Converts the value of self
to an i128
. If the value cannot be\nrepresented by an i128
(i64
under the default implementation), then\nNone
is returned. Read moresource§fn to_usize(&self) -> Option<usize>
Converts the value of self
to a usize
. If the value cannot be\nrepresented by a usize
, then None
is returned.source§fn to_u8(&self) -> Option<u8>
Converts the value of self
to a u8
. If the value cannot be\nrepresented by a u8
, then None
is returned.source§fn to_u16(&self) -> Option<u16>
Converts the value of self
to a u16
. If the value cannot be\nrepresented by a u16
, then None
is returned.source§fn to_u32(&self) -> Option<u32>
Converts the value of self
to a u32
. If the value cannot be\nrepresented by a u32
, then None
is returned.source§fn to_u64(&self) -> Option<u64>
Converts the value of self
to a u64
. If the value cannot be\nrepresented by a u64
, then None
is returned.source§fn to_u128(&self) -> Option<u128>
Converts the value of self
to a u128
. If the value cannot be\nrepresented by a u128
(u64
under the default implementation), then\nNone
is returned. Read more","ToPrimitive","gosling::context::HandshakeHandle"],["","ToSql","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","TryFrom>","gosling::context::HandshakeHandle"],["","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i128> for usize
source§fn try_from(u: i128) -> Result<usize, <usize as TryFrom<i128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i16> for usize
source§fn try_from(u: i16) -> Result<usize, <usize as TryFrom<i16>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i32> for usize
source§fn try_from(u: i32) -> Result<usize, <usize as TryFrom<i32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i64> for usize
source§fn try_from(u: i64) -> Result<usize, <usize as TryFrom<i64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i8> for usize
source§fn try_from(u: i8) -> Result<usize, <usize as TryFrom<i8>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<isize> for usize
source§fn try_from(u: isize) -> Result<usize, <usize as TryFrom<isize>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u128> for usize
source§fn try_from(u: u128) -> Result<usize, <usize as TryFrom<u128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u32> for usize
source§fn try_from(value: u32) -> Result<usize, <usize as TryFrom<u32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u64> for usize
source§fn try_from(value: u64) -> Result<usize, <usize as TryFrom<u64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["§impl Unsigned for usize
§fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.§fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
. Read more§fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to n
. If the\nnext power of two is greater than the type’s maximum value, None
is\nreturned, otherwise the power of two is wrapped in Some
.","Unsigned","gosling::context::HandshakeHandle"],["","UpperExp","gosling::context::HandshakeHandle"],["","UpperHex","gosling::context::HandshakeHandle"],["","Value","gosling::context::HandshakeHandle"],["source§impl WrappingAdd for usize
source§fn wrapping_add(&self, v: &usize) -> usize
Wrapping (modular) addition. Computes self + other
, wrapping around at the boundary of\nthe type.","WrappingAdd","gosling::context::HandshakeHandle"],["source§impl WrappingMul for usize
source§fn wrapping_mul(&self, v: &usize) -> usize
Wrapping (modular) multiplication. Computes self * other
, wrapping around at the boundary\nof the type.","WrappingMul","gosling::context::HandshakeHandle"],["source§impl WrappingNeg for usize
source§fn wrapping_neg(&self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type. Read more","WrappingNeg","gosling::context::HandshakeHandle"],["source§impl WrappingShl for usize
","WrappingShl","gosling::context::HandshakeHandle"],["source§impl WrappingShr for usize
","WrappingShr","gosling::context::HandshakeHandle"],["source§impl WrappingSub for usize
source§fn wrapping_sub(&self, v: &usize) -> usize
Wrapping (modular) subtraction. Computes self - other
, wrapping around at the boundary\nof the type.","WrappingSub","gosling::context::HandshakeHandle"],["","WriteHex","gosling::context::HandshakeHandle"],["§impl Writeable for usize
§fn write_to<W>(&self, sink: &mut W) -> Result<(), Error>
Writes a string to the given sink. Errors from the sink are bubbled up.\nThe default implementation delegates to write_to_parts
, and discards any\nPart
annotations.§fn writeable_length_hint(&self) -> LengthHint
Returns a hint for the number of UTF-8 bytes that will be written to the sink. Read more§fn write_to_parts<S>(&self, sink: &mut S) -> Result<(), Error>where\n S: PartsWrite + ?Sized,
Write bytes and Part
annotations to the given sink. Errors from the\nsink are bubbled up. The default implementation delegates to write_to
,\nand doesn’t produce any Part
annotations.§fn write_to_string(&self) -> Cow<'_, str>
Creates a new String
with the data from this Writeable
. Like ToString
,\nbut smaller and faster. Read more§fn writeable_cmp_bytes(&self, other: &[u8]) -> Ordering
Compares the contents of this Writeable
to the given bytes\nwithout allocating a String to hold the Writeable
contents. Read more","Writeable","gosling::context::HandshakeHandle"],["§impl<'a> Yokeable<'a> for usize
§fn transform_owned(self) -> <usize as Yokeable<'a>>::Output
§unsafe fn make(this: <usize as Yokeable<'a>>::Output) -> usize
This method can be used to cast away Self<'a>
’s lifetime. Read more§fn transform_mut<F>(&'a mut self, f: F)
This method must cast self
between &'a mut Self<'static>
and &'a mut Self<'a>
,\nand pass it to f
. Read more","Yokeable<'a>","gosling::context::HandshakeHandle"],["","Zero","gosling::context::HandshakeHandle"],["","ZeroFrom<'a, usize>","gosling::context::HandshakeHandle"],["§impl<'a> ZeroMapKV<'a> for usize
","ZeroMapKV<'a>","gosling::context::HandshakeHandle"],["source§impl usize
1.43.0 · sourcepub const MIN: usize = 0usize
The smallest value that can be represented by this integer type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MIN, 0);
\n1.43.0 · sourcepub const MAX: usize = 18_446_744_073_709_551_615usize
The largest value that can be represented by this integer type\n(264 − 1 on 64-bit targets).
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX, 18446744073709551615);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b01001100usize;\n\nassert_eq!(n.count_ones(), 3);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX.count_zeros(), 0);
\n1.0.0 (const: 1.32.0) · sourcepub const fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of self
.
\nDepending on what you’re doing with the value, you might also be interested in the\nilog2
function which returns a consistent number, even if the type widens.
\n§Examples
\nBasic usage:
\n\nlet n = usize::MAX >> 2;\n\nassert_eq!(n.leading_zeros(), 2);
\n1.0.0 (const: 1.32.0) · sourcepub const fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b0101000usize;\n\nassert_eq!(n.trailing_zeros(), 3);
\n1.46.0 (const: 1.46.0) · sourcepub const fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = !(usize::MAX >> 2);\n\nassert_eq!(n.leading_ones(), 2);
\n1.46.0 (const: 1.46.0) · sourcepub const fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b1010111usize;\n\nassert_eq!(n.trailing_ones(), 3);
\nsourcepub const fn cast_signed(self) -> isize
🔬This is a nightly-only experimental API. (integer_sign_cast
)
Returns the bit pattern of self
reinterpreted as a signed integer of the same size.
\nThis produces the same result as an as
cast, but ensures that the bit-width remains\nthe same.
\n§Examples
\nBasic usage:
\n\n#![feature(integer_sign_cast)]\n\nlet n = usize::MAX;\n\nassert_eq!(n.cast_signed(), -1isize);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
,\nwrapping the truncated bits to the end of the resulting integer.
\nPlease note this isn’t the same operation as the <<
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0xaa00000000006e1usize;\nlet m = 0x6e10aa;\n\nassert_eq!(n.rotate_left(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
,\nwrapping the truncated bits to the beginning of the resulting\ninteger.
\nPlease note this isn’t the same operation as the >>
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0x6e10aausize;\nlet m = 0xaa00000000006e1;\n\nassert_eq!(n.rotate_right(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn swap_bytes(self) -> usize
Reverses the byte order of the integer.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.swap_bytes();\n\nassert_eq!(m, 0x5634129078563412);
\n1.37.0 (const: 1.37.0) · sourcepub const fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit,\nsecond least-significant bit becomes second most-significant bit, etc.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.reverse_bits();\n\nassert_eq!(m, 0x6a2c48091e6a2c48);\nassert_eq!(0, 0usize.reverse_bits());
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_be(x: usize) -> usize
Converts an integer from big endian to the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(usize::from_be(n), n)\n} else {\n assert_eq!(usize::from_be(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_le(x: usize) -> usize
Converts an integer from little endian to the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(usize::from_le(n), n)\n} else {\n assert_eq!(usize::from_le(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_be(self) -> usize
Converts self
to big endian from the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(n.to_be(), n)\n} else {\n assert_eq!(n.to_be(), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_le(self) -> usize
Converts self
to little endian from the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(n.to_le(), n)\n} else {\n assert_eq!(n.to_le(), n.swap_bytes())\n}
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
\nif overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!((usize::MAX - 2).checked_add(1), Some(usize::MAX - 1));\nassert_eq!((usize::MAX - 2).checked_add(3), None);
\nsourcepub const fn strict_add(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer addition. Computes self + rhs
, panicking\nif overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!((usize::MAX - 2).strict_add(1), usize::MAX - 1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add(3);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_add(self, rhs: usize) -> usize
Unchecked integer addition. Computes self + rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_add(y)
is semantically equivalent to calling\nx.
checked_add
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_add
.
\n§Safety
\nThis results in undefined behavior when\nself + rhs > usize::MAX
or self + rhs < usize::MIN
,\ni.e. when checked_add
would return None
.
\n1.66.0 (const: 1.66.0) · sourcepub const fn checked_add_signed(self, rhs: isize) -> Option<usize>
Checked addition with a signed integer. Computes self + rhs
,\nreturning None
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_add_signed(2), Some(3));\nassert_eq!(1usize.checked_add_signed(-2), None);\nassert_eq!((usize::MAX - 2).checked_add_signed(3), None);
\nsourcepub const fn strict_add_signed(self, rhs: isize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict addition with a signed integer. Computes self + rhs
,\npanicking if overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_add_signed(2), 3);
\nThe following panic because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_add_signed(-2);
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add_signed(3);
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_sub(1), Some(0));\nassert_eq!(0usize.checked_sub(1), None);
\nsourcepub const fn strict_sub(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer subtraction. Computes self - rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_sub(1), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0usize.strict_sub(1);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_sub(self, rhs: usize) -> usize
Unchecked integer subtraction. Computes self - rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_sub(y)
is semantically equivalent to calling\nx.
checked_sub
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_sub
.
\nIf you find yourself writing code like this:
\n\nif foo >= bar {\n // SAFETY: just checked it will not overflow\n let diff = unsafe { foo.unchecked_sub(bar) };\n // ... use diff ...\n}
\nConsider changing it to
\n\nif let Some(diff) = foo.checked_sub(bar) {\n // ... use diff ...\n}
\nAs that does exactly the same thing – including telling the optimizer\nthat the subtraction cannot overflow – but avoids needing unsafe
.
\n§Safety
\nThis results in undefined behavior when\nself - rhs > usize::MAX
or self - rhs < usize::MIN
,\ni.e. when checked_sub
would return None
.
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_mul(1), Some(5));\nassert_eq!(usize::MAX.checked_mul(2), None);
\nsourcepub const fn strict_mul(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer multiplication. Computes self * rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(5usize.strict_mul(1), 5);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_mul(2);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_mul(self, rhs: usize) -> usize
Unchecked integer multiplication. Computes self * rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_mul(y)
is semantically equivalent to calling\nx.
checked_mul
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_mul
.
\n§Safety
\nThis results in undefined behavior when\nself * rhs > usize::MAX
or self * rhs < usize::MIN
,\ni.e. when checked_mul
would return None
.
\n1.0.0 (const: 1.52.0) · sourcepub const fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div(2), Some(64));\nassert_eq!(1usize.checked_div(0), None);
\nsourcepub const fn strict_div(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer division. Computes self / rhs
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div_euclid(2), Some(64));\nassert_eq!(1usize.checked_div_euclid(0), None);
\nsourcepub const fn strict_div_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean division. Computes self.div_euclid(rhs)
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div_euclid(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div_euclid(0);
\n1.7.0 (const: 1.52.0) · sourcepub const fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem(2), Some(1));\nassert_eq!(5usize.checked_rem(0), None);
\nsourcepub const fn strict_rem(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer remainder. Computes self % rhs
.\nStrict remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean modulo. Computes self.rem_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem_euclid(2), Some(1));\nassert_eq!(5usize.checked_rem_euclid(0), None);
\nsourcepub const fn strict_rem_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean modulo. Computes self.rem_euclid(rhs)
.\nStrict modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem_euclid(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem_euclid(0);
\n1.67.0 (const: 1.67.0) · sourcepub const fn ilog(self, base: usize) -> u32
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nThis method might not be optimized owing to implementation details;\nilog2
can produce results more efficiently for base 2, and ilog10
\ncan produce results more efficiently for base 10.
\n§Panics
\nThis function will panic if self
is zero, or if base
is less than 2.
\n§Examples
\nassert_eq!(5usize.ilog(5), 1);
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog(self, base: usize) -> Option<u32>
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nReturns None
if the number is zero, or if the base is not at least 2.
\nThis method might not be optimized owing to implementation details;\nchecked_ilog2
can produce results more efficiently for base 2, and\nchecked_ilog10
can produce results more efficiently for base 10.
\n§Examples
\nassert_eq!(5usize.checked_ilog(5), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog2(self) -> Option<u32>
Returns the base 2 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(2usize.checked_ilog2(), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog10(self) -> Option<u32>
Returns the base 10 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(10usize.checked_ilog10(), Some(1));
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_neg(self) -> Option<usize>
Checked negation. Computes -self
, returning None
unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0usize.checked_neg(), Some(0));\nassert_eq!(1usize.checked_neg(), None);
\nsourcepub const fn strict_neg(self) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict negation. Computes -self
, panicking unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0usize.strict_neg(), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_neg();
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x1usize.checked_shl(4), Some(0x10));\nassert_eq!(0x10usize.checked_shl(129), None);
\nsourcepub const fn strict_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift left. Computes self << rhs
, panicking if rhs
is larger\nthan or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x1usize.strict_shl(4), 0x10);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shl(129);
\nsourcepub const unsafe fn unchecked_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift left. Computes self << rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shl
would return None
.
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x10usize.checked_shr(4), Some(0x1));\nassert_eq!(0x10usize.checked_shr(129), None);
\nsourcepub const fn strict_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift right. Computes self >> rhs
, panicking rhs
is\nlarger than or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x10usize.strict_shr(4), 0x1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shr(129);
\nsourcepub const unsafe fn unchecked_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift right. Computes self >> rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shr
would return None
.
\n1.34.0 (const: 1.50.0) · sourcepub const fn checked_pow(self, exp: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_pow(5), Some(32));\nassert_eq!(usize::MAX.checked_pow(2), None);
\nsourcepub const fn strict_pow(self, exp: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict exponentiation. Computes self.pow(exp)
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(2usize.strict_pow(5), 32);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_pow(2);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at\nthe numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_add(1), 101);\nassert_eq!(usize::MAX.saturating_add(127), usize::MAX);
\n1.66.0 (const: 1.66.0) · sourcepub const fn saturating_add_signed(self, rhs: isize) -> usize
Saturating addition with a signed integer. Computes self + rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.saturating_add_signed(2), 3);\nassert_eq!(1usize.saturating_add_signed(-2), 0);\nassert_eq!((usize::MAX - 2).saturating_add_signed(4), usize::MAX);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating\nat the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_sub(27), 73);\nassert_eq!(13usize.saturating_sub(127), 0);
\n1.7.0 (const: 1.47.0) · sourcepub const fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.saturating_mul(10), 20);\nassert_eq!((usize::MAX).saturating_mul(10), usize::MAX);
\n1.58.0 (const: 1.58.0) · sourcepub const fn saturating_div(self, rhs: usize) -> usize
1.34.0 (const: 1.50.0) · sourcepub const fn saturating_pow(self, exp: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(4usize.saturating_pow(3), 64);\nassert_eq!(usize::MAX.saturating_pow(2), usize::MAX);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(200usize.wrapping_add(55), 255);\nassert_eq!(200usize.wrapping_add(usize::MAX), 199);
\n1.66.0 (const: 1.66.0) · sourcepub const fn wrapping_add_signed(self, rhs: isize) -> usize
Wrapping (modular) addition with a signed integer. Computes\nself + rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_add_signed(2), 3);\nassert_eq!(1usize.wrapping_add_signed(-2), usize::MAX);\nassert_eq!((usize::MAX - 2).wrapping_add_signed(4), 1);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_sub(100), 0);\nassert_eq!(100usize.wrapping_sub(usize::MAX), 101);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u8
is used here.
\n\nassert_eq!(10u8.wrapping_mul(12), 120);\nassert_eq!(25u8.wrapping_mul(12), 44);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div(10), 10);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div_euclid(10), 10);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
.\nWrapped remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem(10), 0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean modulo. Computes self.rem_euclid(rhs)
.\nWrapped modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem_euclid(10), 0);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type.
\nSince unsigned types do not have negative equivalents\nall applications of this function will wrap (except for -0
).\nFor values smaller than the corresponding signed type’s maximum\nthe result is the same as casting the corresponding signed value.\nAny larger values are equivalent to MAX + 1 - (val - MAX - 1)
where\nMAX
is the corresponding signed type’s maximum.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0_usize.wrapping_neg(), 0);\nassert_eq!(usize::MAX.wrapping_neg(), 1);\nassert_eq!(13_usize.wrapping_neg(), (!13) + 1);\nassert_eq!(42_usize.wrapping_neg(), !(42 - 1));
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-left; the\nRHS of a wrapping shift-left is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_left
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_shl(7), 128);\nassert_eq!(1usize.wrapping_shl(128), 1);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-right; the\nRHS of a wrapping shift-right is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_right
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.wrapping_shr(7), 1);\nassert_eq!(128usize.wrapping_shr(128), 128);
\n1.34.0 (const: 1.50.0) · sourcepub const fn wrapping_pow(self, exp: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.wrapping_pow(5), 243);\nassert_eq!(3u8.wrapping_pow(6), 217);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_add(self, rhs: usize) -> (usize, bool)
Calculates self
+ rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_add(2), (7, false));\nassert_eq!(usize::MAX.overflowing_add(1), (0, true));
\nsourcepub const fn carrying_add(self, rhs: usize, carry: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
+ rhs
+ carry
and returns a tuple containing\nthe sum and the output carry.
\nPerforms “ternary addition” of two integer operands and a carry-in\nbit, and returns an output integer and a carry-out bit. This allows\nchaining together multiple additions to create a wider addition, and\ncan be useful for bignum addition.
\nThis can be thought of as a 64-bit “full adder”, in the electronics sense.
\nIf the input carry is false, this method is equivalent to\noverflowing_add
, and the output carry is\nequal to the overflow flag. Note that although carry and overflow\nflags are similar for unsigned integers, they are different for\nsigned integers.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 3 MAX (a = 3 × 2^64 + 2^64 - 1)\n// + 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 9 6 (sum = 9 × 2^64 + 6)\n\nlet (a1, a0): (usize, usize) = (3, usize::MAX);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet carry0 = false;\n\nlet (sum0, carry1) = a0.carrying_add(b0, carry0);\nassert_eq!(carry1, true);\nlet (sum1, carry2) = a1.carrying_add(b1, carry1);\nassert_eq!(carry2, false);\n\nassert_eq!((sum1, sum0), (9, 6));
\n1.66.0 (const: 1.66.0) · sourcepub const fn overflowing_add_signed(self, rhs: isize) -> (usize, bool)
Calculates self
+ rhs
with a signed rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.overflowing_add_signed(2), (3, false));\nassert_eq!(1usize.overflowing_add_signed(-2), (usize::MAX, true));\nassert_eq!((usize::MAX - 2).overflowing_add_signed(4), (1, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_sub(self, rhs: usize) -> (usize, bool)
Calculates self
- rhs
\nReturns a tuple of the subtraction along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_sub(2), (3, false));\nassert_eq!(0usize.overflowing_sub(1), (usize::MAX, true));
\nsourcepub const fn borrowing_sub(self, rhs: usize, borrow: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
− rhs
− borrow
and returns a tuple\ncontaining the difference and the output borrow.
\nPerforms “ternary subtraction” by subtracting both an integer\noperand and a borrow-in bit from self
, and returns an output\ninteger and a borrow-out bit. This allows chaining together multiple\nsubtractions to create a wider subtraction, and can be useful for\nbignum subtraction.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 9 6 (a = 9 × 2^64 + 6)\n// - 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 3 MAX (diff = 3 × 2^64 + 2^64 - 1)\n\nlet (a1, a0): (usize, usize) = (9, 6);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet borrow0 = false;\n\nlet (diff0, borrow1) = a0.borrowing_sub(b0, borrow0);\nassert_eq!(borrow1, true);\nlet (diff1, borrow2) = a1.borrowing_sub(b1, borrow1);\nassert_eq!(borrow2, false);\n\nassert_eq!((diff1, diff0), (3, usize::MAX));
\n1.60.0 (const: 1.60.0) · sourcepub const fn abs_diff(self, other: usize) -> usize
Computes the absolute difference between self
and other
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.abs_diff(80), 20usize);\nassert_eq!(100usize.abs_diff(110), 10usize);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_mul(self, rhs: usize) -> (usize, bool)
Calculates the multiplication of self
and rhs
.
\nReturns a tuple of the multiplication along with a boolean\nindicating whether an arithmetic overflow would occur. If an\noverflow would have occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\nassert_eq!(5u32.overflowing_mul(2), (10, false));\nassert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_div(self, rhs: usize) -> (usize, bool)
Calculates the divisor when self
is divided by rhs
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div(2), (2, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.overflowing_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div_euclid(2), (2, false));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_rem(self, rhs: usize) -> (usize, bool)
Calculates the remainder when self
is divided by rhs
.
\nReturns a tuple of the remainder after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem(2), (1, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Calculates the remainder self.rem_euclid(rhs)
as if by Euclidean division.
\nReturns a tuple of the modulo after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this operation\nis exactly equal to self.overflowing_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem_euclid(2), (1, false));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_neg(self) -> (usize, bool)
Negates self in an overflowing fashion.
\nReturns !self + 1
using wrapping operations to return the value\nthat represents the negation of this unsigned value. Note that for\npositive unsigned values overflow always occurs, but negating 0 does\nnot overflow.
\n§Examples
\nBasic usage
\n\nassert_eq!(0usize.overflowing_neg(), (0, false));\nassert_eq!(2usize.overflowing_neg(), (-2i32 as usize, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shl(self, rhs: u32) -> (usize, bool)
Shifts self left by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x1usize.overflowing_shl(4), (0x10, false));\nassert_eq!(0x1usize.overflowing_shl(132), (0x10, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shr(self, rhs: u32) -> (usize, bool)
Shifts self right by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x10usize.overflowing_shr(4), (0x1, false));\nassert_eq!(0x10usize.overflowing_shr(132), (0x1, true));
\n1.34.0 (const: 1.50.0) · sourcepub const fn overflowing_pow(self, exp: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring.
\nReturns a tuple of the exponentiation along with a bool indicating\nwhether an overflow happened.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.overflowing_pow(5), (243, false));\nassert_eq!(3u8.overflowing_pow(6), (217, true));
\n1.0.0 (const: 1.50.0) · sourcepub const fn pow(self, exp: u32) -> usize
Raises self to the power of exp
, using exponentiation by squaring.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.pow(5), 32);
\nsourcepub const fn isqrt(self) -> usize
🔬This is a nightly-only experimental API. (isqrt
)
Returns the square root of the number, rounded down.
\n§Examples
\nBasic usage:
\n\n#![feature(isqrt)]\nassert_eq!(10usize.isqrt(), 3);
\n1.38.0 (const: 1.52.0) · sourcepub const fn div_euclid(self, rhs: usize) -> usize
1.38.0 (const: 1.52.0) · sourcepub const fn rem_euclid(self, rhs: usize) -> usize
Calculates the least remainder of self (mod rhs)
.
\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self % rhs
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(7usize.rem_euclid(4), 3); // or any other integer type
\nsourcepub const fn div_floor(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (int_roundings
)
Calculates the quotient of self
and rhs
, rounding the result towards negative infinity.
\nThis is the same as performing self / rhs
for all unsigned integers.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(int_roundings)]\nassert_eq!(7_usize.div_floor(4), 1);
\n1.73.0 (const: 1.73.0) · sourcepub const fn next_multiple_of(self, rhs: usize) -> usize
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Overflow behavior
\nOn overflow, this function will panic if overflow checks are enabled (default in debug\nmode) and wrap if overflow checks are disabled (default in release mode).
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.next_multiple_of(8), 16);\nassert_eq!(23_usize.next_multiple_of(8), 24);
\n1.73.0 (const: 1.73.0) · sourcepub const fn checked_next_multiple_of(self, rhs: usize) -> Option<usize>
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
. Returns None
if rhs
is zero or the\noperation would result in overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.checked_next_multiple_of(8), Some(16));\nassert_eq!(23_usize.checked_next_multiple_of(8), Some(24));\nassert_eq!(1_usize.checked_next_multiple_of(0), None);\nassert_eq!(usize::MAX.checked_next_multiple_of(2), None);
\n1.0.0 (const: 1.32.0) · sourcepub const fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.
\n§Examples
\nBasic usage:
\n\nassert!(16usize.is_power_of_two());\nassert!(!10usize.is_power_of_two());
\n1.0.0 (const: 1.50.0) · sourcepub const fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
.
\nWhen return value overflows (i.e., self > (1 << (N-1))
for type\nuN
), it panics in debug mode and the return value is wrapped to 0 in\nrelease mode (the only situation in which this method can return 0).
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.next_power_of_two(), 2);\nassert_eq!(3usize.next_power_of_two(), 4);\nassert_eq!(0usize.next_power_of_two(), 1);
\n1.0.0 (const: 1.50.0) · sourcepub const fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to self
. If\nthe next power of two is greater than the type’s maximum value,\nNone
is returned, otherwise the power of two is wrapped in Some
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_next_power_of_two(), Some(2));\nassert_eq!(3usize.checked_next_power_of_two(), Some(4));\nassert_eq!(usize::MAX.checked_next_power_of_two(), None);
\nsourcepub const fn wrapping_next_power_of_two(self) -> usize
🔬This is a nightly-only experimental API. (wrapping_next_power_of_two
)
Returns the smallest power of two greater than or equal to n
. If\nthe next power of two is greater than the type’s maximum value,\nthe return value is wrapped to 0
.
\n§Examples
\nBasic usage:
\n\n#![feature(wrapping_next_power_of_two)]\n\nassert_eq!(2usize.wrapping_next_power_of_two(), 2);\nassert_eq!(3usize.wrapping_next_power_of_two(), 4);\nassert_eq!(usize::MAX.wrapping_next_power_of_two(), 0);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_be_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nbig-endian (network) byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_be_bytes();\nassert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_le_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nlittle-endian byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_le_bytes();\nassert_eq!(bytes, [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_ne_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nnative byte order.
\nAs the target platform’s native endianness is used, portable code\nshould use to_be_bytes
or to_le_bytes
, as appropriate,\ninstead.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_ne_bytes();\nassert_eq!(\n bytes,\n if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n } else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n }\n);
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_be_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in big endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_be_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_be_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_le_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in little endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_le_bytes([0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_le_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_le_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_ne_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its memory representation\nas a byte array in native endianness.
\nAs the target platform’s native endianness is used, portable code\nlikely wants to use from_be_bytes
or from_le_bytes
, as\nappropriate instead.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_ne_bytes(if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n} else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n});\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_ne_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_ne_bytes(int_bytes.try_into().unwrap())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn min_value() -> usize
👎Deprecating in a future version: replaced by the MIN
associated constant on this type
New code should prefer to use\nusize::MIN
instead.
\nReturns the smallest value that can be represented by this integer type.
\n1.0.0 (const: 1.32.0) · sourcepub const fn max_value() -> usize
👎Deprecating in a future version: replaced by the MAX
associated constant on this type
New code should prefer to use\nusize::MAX
instead.
\nReturns the largest value that can be represented by this integer type.
\nsourcepub const fn widening_mul(self, rhs: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the complete product self * rhs
without the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nIf you also need to add a carry to the wide result, then you want\nSelf::carrying_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.widening_mul(2), (10, 0));\nassert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));
\nsourcepub const fn carrying_mul(self, rhs: usize, carry: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the “full multiplication” self * rhs + carry
\nwithout the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nPerforms “long multiplication” which takes in an extra amount to add, and may return an\nadditional amount of overflow. This allows for chaining together multiple\nmultiplications to create “big integers” which represent larger values.
\nIf you don’t need the carry
, then you can use Self::widening_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.carrying_mul(2, 0), (10, 0));\nassert_eq!(5u32.carrying_mul(2, 10), (20, 0));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));\nassert_eq!(usize::MAX.carrying_mul(usize::MAX, usize::MAX), (0, usize::MAX));
\nThis is the core operation needed for scalar multiplication when\nimplementing it for wider-than-native types.
\n\n#![feature(bigint_helper_methods)]\nfn scalar_mul_eq(little_endian_digits: &mut Vec<u16>, multiplicand: u16) {\n let mut carry = 0;\n for d in little_endian_digits.iter_mut() {\n (*d, carry) = d.carrying_mul(multiplicand, carry);\n }\n if carry != 0 {\n little_endian_digits.push(carry);\n }\n}\n\nlet mut v = vec![10, 20];\nscalar_mul_eq(&mut v, 3);\nassert_eq!(v, [30, 60]);\n\nassert_eq!(0x87654321_u64 * 0xFEED, 0x86D3D159E38D);\nlet mut v = vec![0x4321, 0x8765];\nscalar_mul_eq(&mut v, 0xFEED);\nassert_eq!(v, [0xE38D, 0xD159, 0x86D3]);
\nIf carry
is zero, this is similar to overflowing_mul
,\nexcept that it gives the value of the overflow instead of just whether one happened:
\n\n#![feature(bigint_helper_methods)]\nlet r = u8::carrying_mul(7, 13, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));\nlet r = u8::carrying_mul(13, 42, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(13, 42));
\nThe value of the first field in the returned tuple matches what you’d get\nby combining the wrapping_mul
and\nwrapping_add
methods:
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(\n 789_u16.carrying_mul(456, 123).0,\n 789_u16.wrapping_mul(456).wrapping_add(123),\n);
\nsourcepub const fn midpoint(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (num_midpoint
)
Calculates the middle point of self
and rhs
.
\nmidpoint(a, b)
is (a + b) >> 1
as if it were performed in a\nsufficiently-large signed integral type. This implies that the result is\nalways rounded towards negative infinity and that no overflow will ever occur.
\n§Examples
\n#![feature(num_midpoint)]\nassert_eq!(0usize.midpoint(4), 2);\nassert_eq!(1usize.midpoint(4), 2);
\n",0,"gosling::context::HandshakeHandle"],["source§impl usize
1.0.0 (const: unstable) · sourcepub fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer.
\nThe string is expected to be an optional +
sign\nfollowed by digits.\nLeading and trailing whitespace represent an error.\nDigits are a subset of these characters, depending on radix
:
\n\n0-9
\na-z
\nA-Z
\n
\n§Panics
\nThis function panics if radix
is not in the range from 2 to 36.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::from_str_radix(\"A\", 16), Ok(10));
\n",0,"gosling::context::HandshakeHandle"],["§impl AtLeast16 for usize
","AtLeast16","gosling::context::HandshakeHandle"],["§impl AtLeast32 for usize
","AtLeast32","gosling::context::HandshakeHandle"],["§impl AtLeast64 for usize
","AtLeast64","gosling::context::HandshakeHandle"],["§impl AtLeast8 for usize
","AtLeast8","gosling::context::HandshakeHandle"],["§impl AtMost128 for usize
","AtMost128","gosling::context::HandshakeHandle"],["§impl AtMost64 for usize
","AtMost64","gosling::context::HandshakeHandle"],["§impl BitOps for usize
","BitOps","gosling::context::HandshakeHandle"],["source§impl ConstParamTy for usize
","ConstParamTy","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Copy for usize
","Copy","gosling::context::HandshakeHandle"],["§impl DefaultIsZeroes for usize
","DefaultIsZeroes","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Eq for usize
","Eq","gosling::context::HandshakeHandle"],["§impl ExtendTarget<usize> for usize
","ExtendTarget","gosling::context::HandshakeHandle"],["source§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["source§impl Integer for usize
","Integer","gosling::context::HandshakeHandle"],["§impl Is64 for usize
","Is64","gosling::context::HandshakeHandle"],["§impl NotAutoValue for usize
","NotAutoValue","gosling::context::HandshakeHandle"],["§impl NumericOps for usize
","NumericOps","gosling::context::HandshakeHandle"],["source§impl SimdCast for usize
","SimdCast","gosling::context::HandshakeHandle"],["source§impl StructuralPartialEq for usize
","StructuralPartialEq","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u16> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u8> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<usize> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["source§impl TrustedStep for usize
","TrustedStep","gosling::context::HandshakeHandle"],["§impl Uint for usize
","Uint","gosling::context::HandshakeHandle"],["source§impl Unsigned for usize
","Unsigned","gosling::context::HandshakeHandle"],["source§impl Weight for usize
","Weight","gosling::context::HandshakeHandle"],["source§impl ZeroablePrimitive for usize
","ZeroablePrimitive","gosling::context::HandshakeHandle"]],
-"tor_interface":[["","Accumulate","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Add<&usize>","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","tor_interface::tor_provider::CircuitToken"],["","AsAny","tor_interface::tor_provider::CircuitToken"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["","Binary","tor_interface::tor_provider::CircuitToken"],["","BitAnd<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitAnd","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","tor_interface::tor_provider::CircuitToken"],["","BitOr<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitOr","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","tor_interface::tor_provider::CircuitToken"],["","BitRegister","tor_interface::tor_provider::CircuitToken"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","tor_interface::tor_provider::CircuitToken"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","tor_interface::tor_provider::CircuitToken"],["","BitXor<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitXor","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","tor_interface::tor_provider::CircuitToken"],["","Bits","tor_interface::tor_provider::CircuitToken"],["","Bounded","tor_interface::tor_provider::CircuitToken"],["","CastSigned","tor_interface::tor_provider::CircuitToken"],["","CastUnsigned","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedAdd for usize
","CheckedAdd","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedDiv for usize
","CheckedDiv","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedMul for usize
","CheckedMul","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedNeg for usize
","CheckedNeg","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedRem for usize
","CheckedRem","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShl for usize
","CheckedShl","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShr for usize
","CheckedShr","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedSub for usize
","CheckedSub","tor_interface::tor_provider::CircuitToken"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","tor_interface::tor_provider::CircuitToken"],["","Clone","tor_interface::tor_provider::CircuitToken"],["","ConstOne","tor_interface::tor_provider::CircuitToken"],["","ConstZero","tor_interface::tor_provider::CircuitToken"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","tor_interface::tor_provider::CircuitToken"],["","Debug","tor_interface::tor_provider::CircuitToken"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","tor_interface::tor_provider::CircuitToken"],["","Default","tor_interface::tor_provider::CircuitToken"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","tor_interface::tor_provider::CircuitToken"],["","Display","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Div<&usize>","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","tor_interface::tor_provider::CircuitToken"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","tor_interface::tor_provider::CircuitToken"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","tor_interface::tor_provider::CircuitToken"],["","FmtConst","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","tor_interface::tor_provider::CircuitToken"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","tor_interface::tor_provider::CircuitToken"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","tor_interface::tor_provider::CircuitToken"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","tor_interface::tor_provider::CircuitToken"],["","FromStr","tor_interface::tor_provider::CircuitToken"],["","FromZeroes","tor_interface::tor_provider::CircuitToken"],["","Fundamental","tor_interface::tor_provider::CircuitToken"],["","Hash","tor_interface::tor_provider::CircuitToken"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","tor_interface::tor_provider::CircuitToken"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","tor_interface::tor_provider::CircuitToken"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","tor_interface::tor_provider::CircuitToken"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","tor_interface::tor_provider::CircuitToken"],["","LowerExp","tor_interface::tor_provider::CircuitToken"],["","LowerHex","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Mul<&usize>","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","MulAdd","tor_interface::tor_provider::CircuitToken"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","tor_interface::tor_provider::CircuitToken"],["","Not","tor_interface::tor_provider::CircuitToken"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","tor_interface::tor_provider::CircuitToken"],["","NumCast","tor_interface::tor_provider::CircuitToken"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","tor_interface::tor_provider::CircuitToken"],["","Octal","tor_interface::tor_provider::CircuitToken"],["","One","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Ord for usize
","Ord","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingAdd for usize
","OverflowingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingMul for usize
","OverflowingMul","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingSub for usize
","OverflowingSub","tor_interface::tor_provider::CircuitToken"],["","ParseHex","tor_interface::tor_provider::CircuitToken"],["source§impl PartialEq<Value> for usize
","PartialEq","tor_interface::tor_provider::CircuitToken"],["","PartialEq","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","tor_interface::tor_provider::CircuitToken"],["","PhfBorrow","tor_interface::tor_provider::CircuitToken"],["","PhfHash","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u16>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u32>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u8>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","tor_interface::tor_provider::CircuitToken"],["","Product<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Product","tor_interface::tor_provider::CircuitToken"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Rem<&usize>","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","tor_interface::tor_provider::CircuitToken"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["source§impl Roots for usize
","Roots","tor_interface::tor_provider::CircuitToken"],["","RowIndex","tor_interface::tor_provider::CircuitToken"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","tor_interface::tor_provider::CircuitToken"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","tor_interface::tor_provider::CircuitToken"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","tor_interface::tor_provider::CircuitToken"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","tor_interface::tor_provider::CircuitToken"],["","Shl<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["","Shr<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["
Expand description
Error type for the proxy module
source§impl Debug for ProxyConfigError
impl Debug for ProxyConfigError
source§impl Display for ProxyConfigError
impl Display for ProxyConfigError
source§impl Error for ProxyConfigError
impl Error for ProxyConfigError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
impl Freeze for ProxyConfigError
impl RefUnwindSafe for ProxyConfigError
impl Send for ProxyConfigError
impl Sync for ProxyConfigError
impl Unpin for ProxyConfigError
impl UnwindSafe for ProxyConfigError
source§impl Debug for ProxyConfigError
impl Debug for ProxyConfigError
source§impl Display for ProxyConfigError
impl Display for ProxyConfigError
source§impl Error for ProxyConfigError
impl Error for ProxyConfigError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
impl Freeze for ProxyConfigError
impl RefUnwindSafe for ProxyConfigError
impl Send for ProxyConfigError
impl Sync for ProxyConfigError
impl Unpin for ProxyConfigError
impl UnwindSafe for ProxyConfigError
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
fn implicit(
diff --git a/crates/tor_interface/tor_crypto/enum.SignBit.html b/crates/tor_interface/tor_crypto/enum.SignBit.html
index c7f445ee..46527642 100644
--- a/crates/tor_interface/tor_crypto/enum.SignBit.html
+++ b/crates/tor_interface/tor_crypto/enum.SignBit.html
@@ -2,7 +2,7 @@
Zero,
One,
}Expand description
An enum representing a single bit
-Variants§
Trait Implementations§
source§impl Copy for SignBit
Auto Trait Implementations§
§impl Freeze for SignBit
§impl RefUnwindSafe for SignBit
§impl Send for SignBit
§impl Sync for SignBit
§impl Unpin for SignBit
§impl UnwindSafe for SignBit
Blanket Implementations§
Variants§
Trait Implementations§
source§impl Copy for SignBit
Auto Trait Implementations§
§impl Freeze for SignBit
§impl RefUnwindSafe for SignBit
§impl Send for SignBit
§impl Sync for SignBit
§impl Unpin for SignBit
§impl UnwindSafe for SignBit
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html b/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html
index 415df0b0..d7f04cb7 100644
--- a/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html
+++ b/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html
@@ -16,7 +16,7 @@
sourcepub fn from_private_key(private_key: &Ed25519PrivateKey) -> V3OnionServiceId
Create a V3OnionServiceId
from an Ed25519PrivateKey
.
Trait Implementations§
source§impl Clone for V3OnionServiceId
source§fn clone(&self) -> V3OnionServiceId
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for V3OnionServiceId
source§impl Display for V3OnionServiceId
Trait Implementations§
source§impl Clone for V3OnionServiceId
source§fn clone(&self) -> V3OnionServiceId
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for V3OnionServiceId
source§impl Display for V3OnionServiceId
source§impl Hash for V3OnionServiceId
source§impl Ord for V3OnionServiceId
source§fn cmp(&self, other: &V3OnionServiceId) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/tor_interface/tor_provider/enum.OnionAddr.html b/crates/tor_interface/tor_provider/enum.OnionAddr.html
index 330e8dc7..212631b0 100644
--- a/crates/tor_interface/tor_provider/enum.OnionAddr.html
+++ b/crates/tor_interface/tor_provider/enum.OnionAddr.html
@@ -1,7 +1,7 @@
OnionAddr in tor_interface::tor_provider - Rust Enum tor_interface::tor_provider::OnionAddr
source · pub enum OnionAddr {
V3(OnionAddrV3),
}
Expand description
An onion service address analog to std::net::SocketAddr
-Variants§
§V3(OnionAddrV3)
Trait Implementations§
source§impl Hash for OnionAddr
1.3.0 · source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+
Variants§
§V3(OnionAddrV3)
Trait Implementations§
source§impl Ord for OnionAddr
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/tor_interface/tor_provider/struct.DomainAddr.html b/crates/tor_interface/tor_provider/struct.DomainAddr.html
index 9093e21e..c541ef98 100644
--- a/crates/tor_interface/tor_provider/struct.DomainAddr.html
+++ b/crates/tor_interface/tor_provider/struct.DomainAddr.html
@@ -3,7 +3,7 @@
Implementations§
Trait Implementations§
source§impl Clone for DomainAddr
source§fn clone(&self) -> DomainAddr
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for DomainAddr
source§impl Display for DomainAddr
source§impl FromStr for DomainAddr
Trait Implementations§
source§impl Clone for DomainAddr
source§fn clone(&self) -> DomainAddr
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for DomainAddr
source§impl Display for DomainAddr
source§impl FromStr for DomainAddr
source§impl Hash for DomainAddr
source§impl Ord for DomainAddr
source§fn cmp(&self, other: &DomainAddr) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/type.impl/std/primitive.usize.js b/crates/type.impl/std/primitive.usize.js
index da014e4e..ef01c053 100644
--- a/crates/type.impl/std/primitive.usize.js
+++ b/crates/type.impl/std/primitive.usize.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
-"gosling":[["","Accumulate","gosling::context::HandshakeHandle"],["","Add<&'a BigInt>","gosling::context::HandshakeHandle"],["","Add<&'a BigUint>","gosling::context::HandshakeHandle"],["","Add<&usize>","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","gosling::context::HandshakeHandle"],["","AsAny","gosling::context::HandshakeHandle"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["","Binary","gosling::context::HandshakeHandle"],["","BitAnd<&usize>","gosling::context::HandshakeHandle"],["","BitAnd","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","gosling::context::HandshakeHandle"],["","BitOr<&usize>","gosling::context::HandshakeHandle"],["","BitOr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","gosling::context::HandshakeHandle"],["","BitRegister","gosling::context::HandshakeHandle"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","gosling::context::HandshakeHandle"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","gosling::context::HandshakeHandle"],["","BitXor<&usize>","gosling::context::HandshakeHandle"],["","BitXor","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","gosling::context::HandshakeHandle"],["","Bits","gosling::context::HandshakeHandle"],["","Bounded","gosling::context::HandshakeHandle"],["","CastSigned","gosling::context::HandshakeHandle"],["","CastUnsigned","gosling::context::HandshakeHandle"],["source§impl CheckedAdd for usize
","CheckedAdd","gosling::context::HandshakeHandle"],["source§impl CheckedDiv for usize
","CheckedDiv","gosling::context::HandshakeHandle"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","gosling::context::HandshakeHandle"],["source§impl CheckedMul for usize
","CheckedMul","gosling::context::HandshakeHandle"],["source§impl CheckedNeg for usize
","CheckedNeg","gosling::context::HandshakeHandle"],["source§impl CheckedRem for usize
","CheckedRem","gosling::context::HandshakeHandle"],["source§impl CheckedShl for usize
","CheckedShl","gosling::context::HandshakeHandle"],["source§impl CheckedShr for usize
","CheckedShr","gosling::context::HandshakeHandle"],["source§impl CheckedSub for usize
","CheckedSub","gosling::context::HandshakeHandle"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","gosling::context::HandshakeHandle"],["","Clone","gosling::context::HandshakeHandle"],["","ConstOne","gosling::context::HandshakeHandle"],["","ConstZero","gosling::context::HandshakeHandle"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","gosling::context::HandshakeHandle"],["","Debug","gosling::context::HandshakeHandle"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","gosling::context::HandshakeHandle"],["","Default","gosling::context::HandshakeHandle"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","gosling::context::HandshakeHandle"],["","Display","gosling::context::HandshakeHandle"],["","Div<&'a BigInt>","gosling::context::HandshakeHandle"],["","Div<&'a BigUint>","gosling::context::HandshakeHandle"],["","Div<&usize>","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","gosling::context::HandshakeHandle"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","gosling::context::HandshakeHandle"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","gosling::context::HandshakeHandle"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","gosling::context::HandshakeHandle"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","gosling::context::HandshakeHandle"],["","FmtConst","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","gosling::context::HandshakeHandle"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","gosling::context::HandshakeHandle"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","gosling::context::HandshakeHandle"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","gosling::context::HandshakeHandle"],["","FromStr","gosling::context::HandshakeHandle"],["","FromZeroes","gosling::context::HandshakeHandle"],["","Fundamental","gosling::context::HandshakeHandle"],["","Hash","gosling::context::HandshakeHandle"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","gosling::context::HandshakeHandle"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","gosling::context::HandshakeHandle"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","gosling::context::HandshakeHandle"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","gosling::context::HandshakeHandle"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","gosling::context::HandshakeHandle"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","gosling::context::HandshakeHandle"],["","LowerExp","gosling::context::HandshakeHandle"],["","LowerHex","gosling::context::HandshakeHandle"],["","Mul<&'a BigInt>","gosling::context::HandshakeHandle"],["","Mul<&'a BigUint>","gosling::context::HandshakeHandle"],["","Mul<&usize>","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","MulAdd","gosling::context::HandshakeHandle"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","gosling::context::HandshakeHandle"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","gosling::context::HandshakeHandle"],["","Not","gosling::context::HandshakeHandle"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","gosling::context::HandshakeHandle"],["","NumCast","gosling::context::HandshakeHandle"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","gosling::context::HandshakeHandle"],["","Octal","gosling::context::HandshakeHandle"],["","One","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Ord for usize
","Ord","gosling::context::HandshakeHandle"],["source§impl OverflowingAdd for usize
","OverflowingAdd","gosling::context::HandshakeHandle"],["source§impl OverflowingMul for usize
","OverflowingMul","gosling::context::HandshakeHandle"],["source§impl OverflowingSub for usize
","OverflowingSub","gosling::context::HandshakeHandle"],["","ParseHex","gosling::context::HandshakeHandle"],["source§impl PartialEq<Value> for usize
","PartialEq","gosling::context::HandshakeHandle"],["","PartialEq","gosling::context::HandshakeHandle"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","gosling::context::HandshakeHandle"],["","PhfBorrow","gosling::context::HandshakeHandle"],["","PhfHash","gosling::context::HandshakeHandle"],["","Pow<&'a u16>","gosling::context::HandshakeHandle"],["","Pow<&'a u32>","gosling::context::HandshakeHandle"],["","Pow<&'a u8>","gosling::context::HandshakeHandle"],["","Pow<&'a usize>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","gosling::context::HandshakeHandle"],["","Product<&'a usize>","gosling::context::HandshakeHandle"],["","Product","gosling::context::HandshakeHandle"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","gosling::context::HandshakeHandle"],["","Rem<&'a BigInt>","gosling::context::HandshakeHandle"],["","Rem<&'a BigUint>","gosling::context::HandshakeHandle"],["","Rem<&usize>","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","gosling::context::HandshakeHandle"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","gosling::context::HandshakeHandle"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["source§impl Roots for usize
","Roots","gosling::context::HandshakeHandle"],["","RowIndex","gosling::context::HandshakeHandle"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","gosling::context::HandshakeHandle"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","gosling::context::HandshakeHandle"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","gosling::context::HandshakeHandle"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","gosling::context::HandshakeHandle"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","gosling::context::HandshakeHandle"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","gosling::context::HandshakeHandle"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","gosling::context::HandshakeHandle"],["","Shl<&i128>","gosling::context::HandshakeHandle"],["","Shl<&i16>","gosling::context::HandshakeHandle"],["","Shl<&i32>","gosling::context::HandshakeHandle"],["","Shl<&i64>","gosling::context::HandshakeHandle"],["","Shl<&i8>","gosling::context::HandshakeHandle"],["","Shl<&isize>","gosling::context::HandshakeHandle"],["","Shl<&u128>","gosling::context::HandshakeHandle"],["","Shl<&u16>","gosling::context::HandshakeHandle"],["","Shl<&u32>","gosling::context::HandshakeHandle"],["","Shl<&u64>","gosling::context::HandshakeHandle"],["","Shl<&u8>","gosling::context::HandshakeHandle"],["","Shl<&usize>","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["","Shr<&i128>","gosling::context::HandshakeHandle"],["","Shr<&i16>","gosling::context::HandshakeHandle"],["","Shr<&i32>","gosling::context::HandshakeHandle"],["","Shr<&i64>","gosling::context::HandshakeHandle"],["","Shr<&i8>","gosling::context::HandshakeHandle"],["","Shr<&isize>","gosling::context::HandshakeHandle"],["","Shr<&u128>","gosling::context::HandshakeHandle"],["","Shr<&u16>","gosling::context::HandshakeHandle"],["","Shr<&u32>","gosling::context::HandshakeHandle"],["","Shr<&u64>","gosling::context::HandshakeHandle"],["","Shr<&u8>","gosling::context::HandshakeHandle"],["","Shr<&usize>","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i128> for usize
source§fn shr_assign(&mut self, other: &i128)
Performs the >>=
operation. Read more","ShrAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i16> for usize
source§fn shr_assign(&mut self, other: &i16)
Performs the >>=
operation. Read more","ShrAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i32> for usize
source§fn shr_assign(&mut self, other: &i32)
Performs the >>=
operation. Read more","ShrAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i64> for usize
source§fn shr_assign(&mut self, other: &i64)
Performs the >>=
operation. Read more","ShrAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i8> for usize
source§fn shr_assign(&mut self, other: &i8)
Performs the >>=
operation. Read more","ShrAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&isize> for usize
source§fn shr_assign(&mut self, other: &isize)
Performs the >>=
operation. Read more","ShrAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u128> for usize
source§fn shr_assign(&mut self, other: &u128)
Performs the >>=
operation. Read more","ShrAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u16> for usize
source§fn shr_assign(&mut self, other: &u16)
Performs the >>=
operation. Read more","ShrAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u32> for usize
source§fn shr_assign(&mut self, other: &u32)
Performs the >>=
operation. Read more","ShrAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u64> for usize
source§fn shr_assign(&mut self, other: &u64)
Performs the >>=
operation. Read more","ShrAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u8> for usize
source§fn shr_assign(&mut self, other: &u8)
Performs the >>=
operation. Read more","ShrAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&usize> for usize
source§fn shr_assign(&mut self, other: &usize)
Performs the >>=
operation. Read more","ShrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i128> for usize
source§fn shr_assign(&mut self, other: i128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i16> for usize
source§fn shr_assign(&mut self, other: i16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i32> for usize
source§fn shr_assign(&mut self, other: i32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i64> for usize
source§fn shr_assign(&mut self, other: i64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i8> for usize
source§fn shr_assign(&mut self, other: i8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<isize> for usize
source§fn shr_assign(&mut self, other: isize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u128> for usize
source§fn shr_assign(&mut self, other: u128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u16> for usize
source§fn shr_assign(&mut self, other: u16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u32> for usize
source§fn shr_assign(&mut self, other: u32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u64> for usize
source§fn shr_assign(&mut self, other: u64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u8> for usize
source§fn shr_assign(&mut self, other: u8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign for usize
source§fn shr_assign(&mut self, other: usize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["source§impl SimdElement for usize
","SimdElement","gosling::context::HandshakeHandle"],["1.15.0 (const: unstable) · source§impl<T> SliceIndex<[T]> for usize
The methods index
and index_mut
panic if the index is out of bounds.
\nsource§fn get(self, slice: &[T]) -> Option<&T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a shared reference to the output at this location, if in\nbounds.source§fn get_mut(self, slice: &mut [T]) -> Option<&mut T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable reference to the output at this location, if in\nbounds.source§unsafe fn get_unchecked(self, slice: *const [T]) -> *const T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.source§unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.","SliceIndex<[T]>","gosling::context::HandshakeHandle"],["§impl SmartDisplay for usize
§fn metadata(&self, f: FormatterOptions) -> Metadata<'_, usize>
Compute any information needed to format the value. This must, at a minimum, determine the\nwidth of the value before any padding is added by the formatter. Read more§fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Format the value using the given formatter. This is the same as Display::fmt
. Read more§fn fmt_with_metadata(\n &self,\n f: &mut Formatter<'_>,\n _metadata: Metadata<'_, Self>,\n) -> Result<(), Error>
Format the value using the given formatter and metadata. The formatted output should have\nthe width indicated by the metadata. This is before any padding is added by the\nformatter. Read more","SmartDisplay","gosling::context::HandshakeHandle"],["source§impl Step for usize
source§fn forward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn backward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn forward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn backward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn steps_between(start: &usize, end: &usize) -> Option<usize>
🔬This is a nightly-only experimental API. (step_trait
)","Step","gosling::context::HandshakeHandle"],["","Sub<&'a BigInt>","gosling::context::HandshakeHandle"],["","Sub<&'a BigUint>","gosling::context::HandshakeHandle"],["","Sub<&usize>","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["1.22.0 · source§impl SubAssign<&usize> for usize
source§fn sub_assign(&mut self, other: &usize)
Performs the -=
operation. Read more","SubAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl SubAssign for usize
source§fn sub_assign(&mut self, other: usize)
Performs the -=
operation. Read more","SubAssign","gosling::context::HandshakeHandle"],["","Sum<&'a usize>","gosling::context::HandshakeHandle"],["","Sum","gosling::context::HandshakeHandle"],["","ToBigInt","gosling::context::HandshakeHandle"],["source§impl ToBigUint for usize
source§fn to_biguint(&self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","ToBigUint","gosling::context::HandshakeHandle"],["source§impl ToBytes for usize
§type Bytes = [u8; 8]
source§fn to_be_bytes(&self) -> <usize as ToBytes>::Bytes
Return the memory representation of this number as a byte array in big-endian byte order. Read more","ToBytes","gosling::context::HandshakeHandle"],["source§impl ToPrimitive for usize
source§fn to_isize(&self) -> Option<isize>
Converts the value of self
to an isize
. If the value cannot be\nrepresented by an isize
, then None
is returned.source§fn to_i8(&self) -> Option<i8>
Converts the value of self
to an i8
. If the value cannot be\nrepresented by an i8
, then None
is returned.source§fn to_i16(&self) -> Option<i16>
Converts the value of self
to an i16
. If the value cannot be\nrepresented by an i16
, then None
is returned.source§fn to_i32(&self) -> Option<i32>
Converts the value of self
to an i32
. If the value cannot be\nrepresented by an i32
, then None
is returned.source§fn to_i64(&self) -> Option<i64>
Converts the value of self
to an i64
. If the value cannot be\nrepresented by an i64
, then None
is returned.source§fn to_i128(&self) -> Option<i128>
Converts the value of self
to an i128
. If the value cannot be\nrepresented by an i128
(i64
under the default implementation), then\nNone
is returned. Read moresource§fn to_usize(&self) -> Option<usize>
Converts the value of self
to a usize
. If the value cannot be\nrepresented by a usize
, then None
is returned.source§fn to_u8(&self) -> Option<u8>
Converts the value of self
to a u8
. If the value cannot be\nrepresented by a u8
, then None
is returned.source§fn to_u16(&self) -> Option<u16>
Converts the value of self
to a u16
. If the value cannot be\nrepresented by a u16
, then None
is returned.source§fn to_u32(&self) -> Option<u32>
Converts the value of self
to a u32
. If the value cannot be\nrepresented by a u32
, then None
is returned.source§fn to_u64(&self) -> Option<u64>
Converts the value of self
to a u64
. If the value cannot be\nrepresented by a u64
, then None
is returned.source§fn to_u128(&self) -> Option<u128>
Converts the value of self
to a u128
. If the value cannot be\nrepresented by a u128
(u64
under the default implementation), then\nNone
is returned. Read more","ToPrimitive","gosling::context::HandshakeHandle"],["","ToSql","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","TryFrom>","gosling::context::HandshakeHandle"],["","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i128> for usize
source§fn try_from(u: i128) -> Result<usize, <usize as TryFrom<i128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i16> for usize
source§fn try_from(u: i16) -> Result<usize, <usize as TryFrom<i16>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i32> for usize
source§fn try_from(u: i32) -> Result<usize, <usize as TryFrom<i32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i64> for usize
source§fn try_from(u: i64) -> Result<usize, <usize as TryFrom<i64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i8> for usize
source§fn try_from(u: i8) -> Result<usize, <usize as TryFrom<i8>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<isize> for usize
source§fn try_from(u: isize) -> Result<usize, <usize as TryFrom<isize>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u128> for usize
source§fn try_from(u: u128) -> Result<usize, <usize as TryFrom<u128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u32> for usize
source§fn try_from(value: u32) -> Result<usize, <usize as TryFrom<u32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u64> for usize
source§fn try_from(value: u64) -> Result<usize, <usize as TryFrom<u64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["§impl Unsigned for usize
§fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.§fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
. Read more§fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to n
. If the\nnext power of two is greater than the type’s maximum value, None
is\nreturned, otherwise the power of two is wrapped in Some
.","Unsigned","gosling::context::HandshakeHandle"],["","UpperExp","gosling::context::HandshakeHandle"],["","UpperHex","gosling::context::HandshakeHandle"],["","Value","gosling::context::HandshakeHandle"],["source§impl WrappingAdd for usize
source§fn wrapping_add(&self, v: &usize) -> usize
Wrapping (modular) addition. Computes self + other
, wrapping around at the boundary of\nthe type.","WrappingAdd","gosling::context::HandshakeHandle"],["source§impl WrappingMul for usize
source§fn wrapping_mul(&self, v: &usize) -> usize
Wrapping (modular) multiplication. Computes self * other
, wrapping around at the boundary\nof the type.","WrappingMul","gosling::context::HandshakeHandle"],["source§impl WrappingNeg for usize
source§fn wrapping_neg(&self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type. Read more","WrappingNeg","gosling::context::HandshakeHandle"],["source§impl WrappingShl for usize
","WrappingShl","gosling::context::HandshakeHandle"],["source§impl WrappingShr for usize
","WrappingShr","gosling::context::HandshakeHandle"],["source§impl WrappingSub for usize
source§fn wrapping_sub(&self, v: &usize) -> usize
Wrapping (modular) subtraction. Computes self - other
, wrapping around at the boundary\nof the type.","WrappingSub","gosling::context::HandshakeHandle"],["","WriteHex","gosling::context::HandshakeHandle"],["§impl Writeable for usize
§fn write_to<W>(&self, sink: &mut W) -> Result<(), Error>
Writes a string to the given sink. Errors from the sink are bubbled up.\nThe default implementation delegates to write_to_parts
, and discards any\nPart
annotations.§fn writeable_length_hint(&self) -> LengthHint
Returns a hint for the number of UTF-8 bytes that will be written to the sink. Read more§fn write_to_parts<S>(&self, sink: &mut S) -> Result<(), Error>where\n S: PartsWrite + ?Sized,
Write bytes and Part
annotations to the given sink. Errors from the\nsink are bubbled up. The default implementation delegates to write_to
,\nand doesn’t produce any Part
annotations.§fn write_to_string(&self) -> Cow<'_, str>
Creates a new String
with the data from this Writeable
. Like ToString
,\nbut smaller and faster. Read more§fn writeable_cmp_bytes(&self, other: &[u8]) -> Ordering
Compares the contents of this Writeable
to the given bytes\nwithout allocating a String to hold the Writeable
contents. Read more","Writeable","gosling::context::HandshakeHandle"],["§impl<'a> Yokeable<'a> for usize
§fn transform_owned(self) -> <usize as Yokeable<'a>>::Output
§unsafe fn make(this: <usize as Yokeable<'a>>::Output) -> usize
This method can be used to cast away Self<'a>
’s lifetime. Read more§fn transform_mut<F>(&'a mut self, f: F)
This method must cast self
between &'a mut Self<'static>
and &'a mut Self<'a>
,\nand pass it to f
. Read more","Yokeable<'a>","gosling::context::HandshakeHandle"],["","Zero","gosling::context::HandshakeHandle"],["","ZeroFrom<'a, usize>","gosling::context::HandshakeHandle"],["§impl<'a> ZeroMapKV<'a> for usize
","ZeroMapKV<'a>","gosling::context::HandshakeHandle"],["source§impl usize
1.43.0 · sourcepub const MIN: usize = 0usize
The smallest value that can be represented by this integer type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MIN, 0);
\n1.43.0 · sourcepub const MAX: usize = 18_446_744_073_709_551_615usize
The largest value that can be represented by this integer type\n(264 − 1 on 64-bit targets).
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX, 18446744073709551615);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b01001100usize;\n\nassert_eq!(n.count_ones(), 3);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX.count_zeros(), 0);
\n1.0.0 (const: 1.32.0) · sourcepub const fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of self
.
\nDepending on what you’re doing with the value, you might also be interested in the\nilog2
function which returns a consistent number, even if the type widens.
\n§Examples
\nBasic usage:
\n\nlet n = usize::MAX >> 2;\n\nassert_eq!(n.leading_zeros(), 2);
\n1.0.0 (const: 1.32.0) · sourcepub const fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b0101000usize;\n\nassert_eq!(n.trailing_zeros(), 3);
\n1.46.0 (const: 1.46.0) · sourcepub const fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = !(usize::MAX >> 2);\n\nassert_eq!(n.leading_ones(), 2);
\n1.46.0 (const: 1.46.0) · sourcepub const fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b1010111usize;\n\nassert_eq!(n.trailing_ones(), 3);
\nsourcepub const fn cast_signed(self) -> isize
🔬This is a nightly-only experimental API. (integer_sign_cast
)
Returns the bit pattern of self
reinterpreted as a signed integer of the same size.
\nThis produces the same result as an as
cast, but ensures that the bit-width remains\nthe same.
\n§Examples
\nBasic usage:
\n\n#![feature(integer_sign_cast)]\n\nlet n = usize::MAX;\n\nassert_eq!(n.cast_signed(), -1isize);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
,\nwrapping the truncated bits to the end of the resulting integer.
\nPlease note this isn’t the same operation as the <<
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0xaa00000000006e1usize;\nlet m = 0x6e10aa;\n\nassert_eq!(n.rotate_left(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
,\nwrapping the truncated bits to the beginning of the resulting\ninteger.
\nPlease note this isn’t the same operation as the >>
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0x6e10aausize;\nlet m = 0xaa00000000006e1;\n\nassert_eq!(n.rotate_right(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn swap_bytes(self) -> usize
Reverses the byte order of the integer.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.swap_bytes();\n\nassert_eq!(m, 0x5634129078563412);
\n1.37.0 (const: 1.37.0) · sourcepub const fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit,\nsecond least-significant bit becomes second most-significant bit, etc.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.reverse_bits();\n\nassert_eq!(m, 0x6a2c48091e6a2c48);\nassert_eq!(0, 0usize.reverse_bits());
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_be(x: usize) -> usize
Converts an integer from big endian to the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(usize::from_be(n), n)\n} else {\n assert_eq!(usize::from_be(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_le(x: usize) -> usize
Converts an integer from little endian to the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(usize::from_le(n), n)\n} else {\n assert_eq!(usize::from_le(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_be(self) -> usize
Converts self
to big endian from the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(n.to_be(), n)\n} else {\n assert_eq!(n.to_be(), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_le(self) -> usize
Converts self
to little endian from the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(n.to_le(), n)\n} else {\n assert_eq!(n.to_le(), n.swap_bytes())\n}
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
\nif overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!((usize::MAX - 2).checked_add(1), Some(usize::MAX - 1));\nassert_eq!((usize::MAX - 2).checked_add(3), None);
\nsourcepub const fn strict_add(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer addition. Computes self + rhs
, panicking\nif overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!((usize::MAX - 2).strict_add(1), usize::MAX - 1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add(3);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_add(self, rhs: usize) -> usize
Unchecked integer addition. Computes self + rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_add(y)
is semantically equivalent to calling\nx.
checked_add
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_add
.
\n§Safety
\nThis results in undefined behavior when\nself + rhs > usize::MAX
or self + rhs < usize::MIN
,\ni.e. when checked_add
would return None
.
\n1.66.0 (const: 1.66.0) · sourcepub const fn checked_add_signed(self, rhs: isize) -> Option<usize>
Checked addition with a signed integer. Computes self + rhs
,\nreturning None
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_add_signed(2), Some(3));\nassert_eq!(1usize.checked_add_signed(-2), None);\nassert_eq!((usize::MAX - 2).checked_add_signed(3), None);
\nsourcepub const fn strict_add_signed(self, rhs: isize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict addition with a signed integer. Computes self + rhs
,\npanicking if overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_add_signed(2), 3);
\nThe following panic because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_add_signed(-2);
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add_signed(3);
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_sub(1), Some(0));\nassert_eq!(0usize.checked_sub(1), None);
\nsourcepub const fn strict_sub(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer subtraction. Computes self - rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_sub(1), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0usize.strict_sub(1);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_sub(self, rhs: usize) -> usize
Unchecked integer subtraction. Computes self - rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_sub(y)
is semantically equivalent to calling\nx.
checked_sub
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_sub
.
\nIf you find yourself writing code like this:
\n\nif foo >= bar {\n // SAFETY: just checked it will not overflow\n let diff = unsafe { foo.unchecked_sub(bar) };\n // ... use diff ...\n}
\nConsider changing it to
\n\nif let Some(diff) = foo.checked_sub(bar) {\n // ... use diff ...\n}
\nAs that does exactly the same thing – including telling the optimizer\nthat the subtraction cannot overflow – but avoids needing unsafe
.
\n§Safety
\nThis results in undefined behavior when\nself - rhs > usize::MAX
or self - rhs < usize::MIN
,\ni.e. when checked_sub
would return None
.
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_mul(1), Some(5));\nassert_eq!(usize::MAX.checked_mul(2), None);
\nsourcepub const fn strict_mul(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer multiplication. Computes self * rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(5usize.strict_mul(1), 5);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_mul(2);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_mul(self, rhs: usize) -> usize
Unchecked integer multiplication. Computes self * rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_mul(y)
is semantically equivalent to calling\nx.
checked_mul
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_mul
.
\n§Safety
\nThis results in undefined behavior when\nself * rhs > usize::MAX
or self * rhs < usize::MIN
,\ni.e. when checked_mul
would return None
.
\n1.0.0 (const: 1.52.0) · sourcepub const fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div(2), Some(64));\nassert_eq!(1usize.checked_div(0), None);
\nsourcepub const fn strict_div(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer division. Computes self / rhs
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div_euclid(2), Some(64));\nassert_eq!(1usize.checked_div_euclid(0), None);
\nsourcepub const fn strict_div_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean division. Computes self.div_euclid(rhs)
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div_euclid(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div_euclid(0);
\n1.7.0 (const: 1.52.0) · sourcepub const fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem(2), Some(1));\nassert_eq!(5usize.checked_rem(0), None);
\nsourcepub const fn strict_rem(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer remainder. Computes self % rhs
.\nStrict remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean modulo. Computes self.rem_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem_euclid(2), Some(1));\nassert_eq!(5usize.checked_rem_euclid(0), None);
\nsourcepub const fn strict_rem_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean modulo. Computes self.rem_euclid(rhs)
.\nStrict modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem_euclid(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem_euclid(0);
\n1.67.0 (const: 1.67.0) · sourcepub const fn ilog(self, base: usize) -> u32
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nThis method might not be optimized owing to implementation details;\nilog2
can produce results more efficiently for base 2, and ilog10
\ncan produce results more efficiently for base 10.
\n§Panics
\nThis function will panic if self
is zero, or if base
is less than 2.
\n§Examples
\nassert_eq!(5usize.ilog(5), 1);
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog(self, base: usize) -> Option<u32>
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nReturns None
if the number is zero, or if the base is not at least 2.
\nThis method might not be optimized owing to implementation details;\nchecked_ilog2
can produce results more efficiently for base 2, and\nchecked_ilog10
can produce results more efficiently for base 10.
\n§Examples
\nassert_eq!(5usize.checked_ilog(5), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog2(self) -> Option<u32>
Returns the base 2 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(2usize.checked_ilog2(), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog10(self) -> Option<u32>
Returns the base 10 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(10usize.checked_ilog10(), Some(1));
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_neg(self) -> Option<usize>
Checked negation. Computes -self
, returning None
unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0usize.checked_neg(), Some(0));\nassert_eq!(1usize.checked_neg(), None);
\nsourcepub const fn strict_neg(self) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict negation. Computes -self
, panicking unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0usize.strict_neg(), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_neg();
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x1usize.checked_shl(4), Some(0x10));\nassert_eq!(0x10usize.checked_shl(129), None);
\nsourcepub const fn strict_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift left. Computes self << rhs
, panicking if rhs
is larger\nthan or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x1usize.strict_shl(4), 0x10);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shl(129);
\nsourcepub const unsafe fn unchecked_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift left. Computes self << rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shl
would return None
.
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x10usize.checked_shr(4), Some(0x1));\nassert_eq!(0x10usize.checked_shr(129), None);
\nsourcepub const fn strict_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift right. Computes self >> rhs
, panicking rhs
is\nlarger than or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x10usize.strict_shr(4), 0x1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shr(129);
\nsourcepub const unsafe fn unchecked_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift right. Computes self >> rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shr
would return None
.
\n1.34.0 (const: 1.50.0) · sourcepub const fn checked_pow(self, exp: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_pow(5), Some(32));\nassert_eq!(usize::MAX.checked_pow(2), None);
\nsourcepub const fn strict_pow(self, exp: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict exponentiation. Computes self.pow(exp)
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(2usize.strict_pow(5), 32);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_pow(2);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at\nthe numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_add(1), 101);\nassert_eq!(usize::MAX.saturating_add(127), usize::MAX);
\n1.66.0 (const: 1.66.0) · sourcepub const fn saturating_add_signed(self, rhs: isize) -> usize
Saturating addition with a signed integer. Computes self + rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.saturating_add_signed(2), 3);\nassert_eq!(1usize.saturating_add_signed(-2), 0);\nassert_eq!((usize::MAX - 2).saturating_add_signed(4), usize::MAX);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating\nat the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_sub(27), 73);\nassert_eq!(13usize.saturating_sub(127), 0);
\n1.7.0 (const: 1.47.0) · sourcepub const fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.saturating_mul(10), 20);\nassert_eq!((usize::MAX).saturating_mul(10), usize::MAX);
\n1.58.0 (const: 1.58.0) · sourcepub const fn saturating_div(self, rhs: usize) -> usize
1.34.0 (const: 1.50.0) · sourcepub const fn saturating_pow(self, exp: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(4usize.saturating_pow(3), 64);\nassert_eq!(usize::MAX.saturating_pow(2), usize::MAX);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(200usize.wrapping_add(55), 255);\nassert_eq!(200usize.wrapping_add(usize::MAX), 199);
\n1.66.0 (const: 1.66.0) · sourcepub const fn wrapping_add_signed(self, rhs: isize) -> usize
Wrapping (modular) addition with a signed integer. Computes\nself + rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_add_signed(2), 3);\nassert_eq!(1usize.wrapping_add_signed(-2), usize::MAX);\nassert_eq!((usize::MAX - 2).wrapping_add_signed(4), 1);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_sub(100), 0);\nassert_eq!(100usize.wrapping_sub(usize::MAX), 101);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u8
is used here.
\n\nassert_eq!(10u8.wrapping_mul(12), 120);\nassert_eq!(25u8.wrapping_mul(12), 44);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div(10), 10);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div_euclid(10), 10);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
.\nWrapped remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem(10), 0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean modulo. Computes self.rem_euclid(rhs)
.\nWrapped modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem_euclid(10), 0);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type.
\nSince unsigned types do not have negative equivalents\nall applications of this function will wrap (except for -0
).\nFor values smaller than the corresponding signed type’s maximum\nthe result is the same as casting the corresponding signed value.\nAny larger values are equivalent to MAX + 1 - (val - MAX - 1)
where\nMAX
is the corresponding signed type’s maximum.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0_usize.wrapping_neg(), 0);\nassert_eq!(usize::MAX.wrapping_neg(), 1);\nassert_eq!(13_usize.wrapping_neg(), (!13) + 1);\nassert_eq!(42_usize.wrapping_neg(), !(42 - 1));
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-left; the\nRHS of a wrapping shift-left is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_left
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_shl(7), 128);\nassert_eq!(1usize.wrapping_shl(128), 1);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-right; the\nRHS of a wrapping shift-right is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_right
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.wrapping_shr(7), 1);\nassert_eq!(128usize.wrapping_shr(128), 128);
\n1.34.0 (const: 1.50.0) · sourcepub const fn wrapping_pow(self, exp: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.wrapping_pow(5), 243);\nassert_eq!(3u8.wrapping_pow(6), 217);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_add(self, rhs: usize) -> (usize, bool)
Calculates self
+ rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_add(2), (7, false));\nassert_eq!(usize::MAX.overflowing_add(1), (0, true));
\nsourcepub const fn carrying_add(self, rhs: usize, carry: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
+ rhs
+ carry
and returns a tuple containing\nthe sum and the output carry.
\nPerforms “ternary addition” of two integer operands and a carry-in\nbit, and returns an output integer and a carry-out bit. This allows\nchaining together multiple additions to create a wider addition, and\ncan be useful for bignum addition.
\nThis can be thought of as a 64-bit “full adder”, in the electronics sense.
\nIf the input carry is false, this method is equivalent to\noverflowing_add
, and the output carry is\nequal to the overflow flag. Note that although carry and overflow\nflags are similar for unsigned integers, they are different for\nsigned integers.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 3 MAX (a = 3 × 2^64 + 2^64 - 1)\n// + 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 9 6 (sum = 9 × 2^64 + 6)\n\nlet (a1, a0): (usize, usize) = (3, usize::MAX);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet carry0 = false;\n\nlet (sum0, carry1) = a0.carrying_add(b0, carry0);\nassert_eq!(carry1, true);\nlet (sum1, carry2) = a1.carrying_add(b1, carry1);\nassert_eq!(carry2, false);\n\nassert_eq!((sum1, sum0), (9, 6));
\n1.66.0 (const: 1.66.0) · sourcepub const fn overflowing_add_signed(self, rhs: isize) -> (usize, bool)
Calculates self
+ rhs
with a signed rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.overflowing_add_signed(2), (3, false));\nassert_eq!(1usize.overflowing_add_signed(-2), (usize::MAX, true));\nassert_eq!((usize::MAX - 2).overflowing_add_signed(4), (1, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_sub(self, rhs: usize) -> (usize, bool)
Calculates self
- rhs
\nReturns a tuple of the subtraction along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_sub(2), (3, false));\nassert_eq!(0usize.overflowing_sub(1), (usize::MAX, true));
\nsourcepub const fn borrowing_sub(self, rhs: usize, borrow: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
− rhs
− borrow
and returns a tuple\ncontaining the difference and the output borrow.
\nPerforms “ternary subtraction” by subtracting both an integer\noperand and a borrow-in bit from self
, and returns an output\ninteger and a borrow-out bit. This allows chaining together multiple\nsubtractions to create a wider subtraction, and can be useful for\nbignum subtraction.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 9 6 (a = 9 × 2^64 + 6)\n// - 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 3 MAX (diff = 3 × 2^64 + 2^64 - 1)\n\nlet (a1, a0): (usize, usize) = (9, 6);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet borrow0 = false;\n\nlet (diff0, borrow1) = a0.borrowing_sub(b0, borrow0);\nassert_eq!(borrow1, true);\nlet (diff1, borrow2) = a1.borrowing_sub(b1, borrow1);\nassert_eq!(borrow2, false);\n\nassert_eq!((diff1, diff0), (3, usize::MAX));
\n1.60.0 (const: 1.60.0) · sourcepub const fn abs_diff(self, other: usize) -> usize
Computes the absolute difference between self
and other
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.abs_diff(80), 20usize);\nassert_eq!(100usize.abs_diff(110), 10usize);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_mul(self, rhs: usize) -> (usize, bool)
Calculates the multiplication of self
and rhs
.
\nReturns a tuple of the multiplication along with a boolean\nindicating whether an arithmetic overflow would occur. If an\noverflow would have occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\nassert_eq!(5u32.overflowing_mul(2), (10, false));\nassert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_div(self, rhs: usize) -> (usize, bool)
Calculates the divisor when self
is divided by rhs
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div(2), (2, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.overflowing_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div_euclid(2), (2, false));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_rem(self, rhs: usize) -> (usize, bool)
Calculates the remainder when self
is divided by rhs
.
\nReturns a tuple of the remainder after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem(2), (1, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Calculates the remainder self.rem_euclid(rhs)
as if by Euclidean division.
\nReturns a tuple of the modulo after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this operation\nis exactly equal to self.overflowing_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem_euclid(2), (1, false));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_neg(self) -> (usize, bool)
Negates self in an overflowing fashion.
\nReturns !self + 1
using wrapping operations to return the value\nthat represents the negation of this unsigned value. Note that for\npositive unsigned values overflow always occurs, but negating 0 does\nnot overflow.
\n§Examples
\nBasic usage
\n\nassert_eq!(0usize.overflowing_neg(), (0, false));\nassert_eq!(2usize.overflowing_neg(), (-2i32 as usize, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shl(self, rhs: u32) -> (usize, bool)
Shifts self left by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x1usize.overflowing_shl(4), (0x10, false));\nassert_eq!(0x1usize.overflowing_shl(132), (0x10, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shr(self, rhs: u32) -> (usize, bool)
Shifts self right by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x10usize.overflowing_shr(4), (0x1, false));\nassert_eq!(0x10usize.overflowing_shr(132), (0x1, true));
\n1.34.0 (const: 1.50.0) · sourcepub const fn overflowing_pow(self, exp: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring.
\nReturns a tuple of the exponentiation along with a bool indicating\nwhether an overflow happened.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.overflowing_pow(5), (243, false));\nassert_eq!(3u8.overflowing_pow(6), (217, true));
\n1.0.0 (const: 1.50.0) · sourcepub const fn pow(self, exp: u32) -> usize
Raises self to the power of exp
, using exponentiation by squaring.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.pow(5), 32);
\nsourcepub const fn isqrt(self) -> usize
🔬This is a nightly-only experimental API. (isqrt
)
Returns the square root of the number, rounded down.
\n§Examples
\nBasic usage:
\n\n#![feature(isqrt)]\nassert_eq!(10usize.isqrt(), 3);
\n1.38.0 (const: 1.52.0) · sourcepub const fn div_euclid(self, rhs: usize) -> usize
1.38.0 (const: 1.52.0) · sourcepub const fn rem_euclid(self, rhs: usize) -> usize
Calculates the least remainder of self (mod rhs)
.
\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self % rhs
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(7usize.rem_euclid(4), 3); // or any other integer type
\nsourcepub const fn div_floor(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (int_roundings
)
Calculates the quotient of self
and rhs
, rounding the result towards negative infinity.
\nThis is the same as performing self / rhs
for all unsigned integers.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(int_roundings)]\nassert_eq!(7_usize.div_floor(4), 1);
\n1.73.0 (const: 1.73.0) · sourcepub const fn next_multiple_of(self, rhs: usize) -> usize
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Overflow behavior
\nOn overflow, this function will panic if overflow checks are enabled (default in debug\nmode) and wrap if overflow checks are disabled (default in release mode).
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.next_multiple_of(8), 16);\nassert_eq!(23_usize.next_multiple_of(8), 24);
\n1.73.0 (const: 1.73.0) · sourcepub const fn checked_next_multiple_of(self, rhs: usize) -> Option<usize>
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
. Returns None
if rhs
is zero or the\noperation would result in overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.checked_next_multiple_of(8), Some(16));\nassert_eq!(23_usize.checked_next_multiple_of(8), Some(24));\nassert_eq!(1_usize.checked_next_multiple_of(0), None);\nassert_eq!(usize::MAX.checked_next_multiple_of(2), None);
\n1.0.0 (const: 1.32.0) · sourcepub const fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.
\n§Examples
\nBasic usage:
\n\nassert!(16usize.is_power_of_two());\nassert!(!10usize.is_power_of_two());
\n1.0.0 (const: 1.50.0) · sourcepub const fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
.
\nWhen return value overflows (i.e., self > (1 << (N-1))
for type\nuN
), it panics in debug mode and the return value is wrapped to 0 in\nrelease mode (the only situation in which this method can return 0).
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.next_power_of_two(), 2);\nassert_eq!(3usize.next_power_of_two(), 4);\nassert_eq!(0usize.next_power_of_two(), 1);
\n1.0.0 (const: 1.50.0) · sourcepub const fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to self
. If\nthe next power of two is greater than the type’s maximum value,\nNone
is returned, otherwise the power of two is wrapped in Some
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_next_power_of_two(), Some(2));\nassert_eq!(3usize.checked_next_power_of_two(), Some(4));\nassert_eq!(usize::MAX.checked_next_power_of_two(), None);
\nsourcepub const fn wrapping_next_power_of_two(self) -> usize
🔬This is a nightly-only experimental API. (wrapping_next_power_of_two
)
Returns the smallest power of two greater than or equal to n
. If\nthe next power of two is greater than the type’s maximum value,\nthe return value is wrapped to 0
.
\n§Examples
\nBasic usage:
\n\n#![feature(wrapping_next_power_of_two)]\n\nassert_eq!(2usize.wrapping_next_power_of_two(), 2);\nassert_eq!(3usize.wrapping_next_power_of_two(), 4);\nassert_eq!(usize::MAX.wrapping_next_power_of_two(), 0);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_be_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nbig-endian (network) byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_be_bytes();\nassert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_le_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nlittle-endian byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_le_bytes();\nassert_eq!(bytes, [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_ne_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nnative byte order.
\nAs the target platform’s native endianness is used, portable code\nshould use to_be_bytes
or to_le_bytes
, as appropriate,\ninstead.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_ne_bytes();\nassert_eq!(\n bytes,\n if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n } else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n }\n);
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_be_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in big endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_be_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_be_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_le_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in little endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_le_bytes([0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_le_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_le_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_ne_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its memory representation\nas a byte array in native endianness.
\nAs the target platform’s native endianness is used, portable code\nlikely wants to use from_be_bytes
or from_le_bytes
, as\nappropriate instead.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_ne_bytes(if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n} else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n});\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_ne_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_ne_bytes(int_bytes.try_into().unwrap())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn min_value() -> usize
👎Deprecating in a future version: replaced by the MIN
associated constant on this type
New code should prefer to use\nusize::MIN
instead.
\nReturns the smallest value that can be represented by this integer type.
\n1.0.0 (const: 1.32.0) · sourcepub const fn max_value() -> usize
👎Deprecating in a future version: replaced by the MAX
associated constant on this type
New code should prefer to use\nusize::MAX
instead.
\nReturns the largest value that can be represented by this integer type.
\nsourcepub const fn widening_mul(self, rhs: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the complete product self * rhs
without the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nIf you also need to add a carry to the wide result, then you want\nSelf::carrying_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.widening_mul(2), (10, 0));\nassert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));
\nsourcepub const fn carrying_mul(self, rhs: usize, carry: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the “full multiplication” self * rhs + carry
\nwithout the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nPerforms “long multiplication” which takes in an extra amount to add, and may return an\nadditional amount of overflow. This allows for chaining together multiple\nmultiplications to create “big integers” which represent larger values.
\nIf you don’t need the carry
, then you can use Self::widening_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.carrying_mul(2, 0), (10, 0));\nassert_eq!(5u32.carrying_mul(2, 10), (20, 0));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));\nassert_eq!(usize::MAX.carrying_mul(usize::MAX, usize::MAX), (0, usize::MAX));
\nThis is the core operation needed for scalar multiplication when\nimplementing it for wider-than-native types.
\n\n#![feature(bigint_helper_methods)]\nfn scalar_mul_eq(little_endian_digits: &mut Vec<u16>, multiplicand: u16) {\n let mut carry = 0;\n for d in little_endian_digits.iter_mut() {\n (*d, carry) = d.carrying_mul(multiplicand, carry);\n }\n if carry != 0 {\n little_endian_digits.push(carry);\n }\n}\n\nlet mut v = vec![10, 20];\nscalar_mul_eq(&mut v, 3);\nassert_eq!(v, [30, 60]);\n\nassert_eq!(0x87654321_u64 * 0xFEED, 0x86D3D159E38D);\nlet mut v = vec![0x4321, 0x8765];\nscalar_mul_eq(&mut v, 0xFEED);\nassert_eq!(v, [0xE38D, 0xD159, 0x86D3]);
\nIf carry
is zero, this is similar to overflowing_mul
,\nexcept that it gives the value of the overflow instead of just whether one happened:
\n\n#![feature(bigint_helper_methods)]\nlet r = u8::carrying_mul(7, 13, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));\nlet r = u8::carrying_mul(13, 42, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(13, 42));
\nThe value of the first field in the returned tuple matches what you’d get\nby combining the wrapping_mul
and\nwrapping_add
methods:
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(\n 789_u16.carrying_mul(456, 123).0,\n 789_u16.wrapping_mul(456).wrapping_add(123),\n);
\nsourcepub const fn midpoint(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (num_midpoint
)
Calculates the middle point of self
and rhs
.
\nmidpoint(a, b)
is (a + b) >> 1
as if it were performed in a\nsufficiently-large signed integral type. This implies that the result is\nalways rounded towards negative infinity and that no overflow will ever occur.
\n§Examples
\n#![feature(num_midpoint)]\nassert_eq!(0usize.midpoint(4), 2);\nassert_eq!(1usize.midpoint(4), 2);
\n",0,"gosling::context::HandshakeHandle"],["source§impl usize
1.0.0 (const: unstable) · sourcepub fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer.
\nThe string is expected to be an optional +
sign\nfollowed by digits.\nLeading and trailing whitespace represent an error.\nDigits are a subset of these characters, depending on radix
:
\n\n0-9
\na-z
\nA-Z
\n
\n§Panics
\nThis function panics if radix
is not in the range from 2 to 36.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::from_str_radix(\"A\", 16), Ok(10));
\n",0,"gosling::context::HandshakeHandle"],["§impl AtLeast16 for usize
","AtLeast16","gosling::context::HandshakeHandle"],["§impl AtLeast32 for usize
","AtLeast32","gosling::context::HandshakeHandle"],["§impl AtLeast64 for usize
","AtLeast64","gosling::context::HandshakeHandle"],["§impl AtLeast8 for usize
","AtLeast8","gosling::context::HandshakeHandle"],["§impl AtMost128 for usize
","AtMost128","gosling::context::HandshakeHandle"],["§impl AtMost64 for usize
","AtMost64","gosling::context::HandshakeHandle"],["§impl BitOps for usize
","BitOps","gosling::context::HandshakeHandle"],["source§impl ConstParamTy for usize
","ConstParamTy","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Copy for usize
","Copy","gosling::context::HandshakeHandle"],["§impl DefaultIsZeroes for usize
","DefaultIsZeroes","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Eq for usize
","Eq","gosling::context::HandshakeHandle"],["§impl ExtendTarget<usize> for usize
","ExtendTarget","gosling::context::HandshakeHandle"],["source§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["source§impl Integer for usize
","Integer","gosling::context::HandshakeHandle"],["§impl Is64 for usize
","Is64","gosling::context::HandshakeHandle"],["§impl NotAutoValue for usize
","NotAutoValue","gosling::context::HandshakeHandle"],["§impl NumericOps for usize
","NumericOps","gosling::context::HandshakeHandle"],["source§impl SimdCast for usize
","SimdCast","gosling::context::HandshakeHandle"],["source§impl StructuralPartialEq for usize
","StructuralPartialEq","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u16> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u8> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<usize> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["source§impl TrustedStep for usize
","TrustedStep","gosling::context::HandshakeHandle"],["§impl Uint for usize
","Uint","gosling::context::HandshakeHandle"],["source§impl Unsigned for usize
","Unsigned","gosling::context::HandshakeHandle"],["source§impl Weight for usize
","Weight","gosling::context::HandshakeHandle"],["source§impl ZeroablePrimitive for usize
","ZeroablePrimitive","gosling::context::HandshakeHandle"]],
-"tor_interface":[["","Accumulate","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Add<&usize>","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","tor_interface::tor_provider::CircuitToken"],["","AsAny","tor_interface::tor_provider::CircuitToken"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["","Binary","tor_interface::tor_provider::CircuitToken"],["","BitAnd<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitAnd","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","tor_interface::tor_provider::CircuitToken"],["","BitOr<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitOr","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","tor_interface::tor_provider::CircuitToken"],["","BitRegister","tor_interface::tor_provider::CircuitToken"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","tor_interface::tor_provider::CircuitToken"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","tor_interface::tor_provider::CircuitToken"],["","BitXor<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitXor","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","tor_interface::tor_provider::CircuitToken"],["","Bits","tor_interface::tor_provider::CircuitToken"],["","Bounded","tor_interface::tor_provider::CircuitToken"],["","CastSigned","tor_interface::tor_provider::CircuitToken"],["","CastUnsigned","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedAdd for usize
","CheckedAdd","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedDiv for usize
","CheckedDiv","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedMul for usize
","CheckedMul","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedNeg for usize
","CheckedNeg","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedRem for usize
","CheckedRem","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShl for usize
","CheckedShl","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShr for usize
","CheckedShr","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedSub for usize
","CheckedSub","tor_interface::tor_provider::CircuitToken"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","tor_interface::tor_provider::CircuitToken"],["","Clone","tor_interface::tor_provider::CircuitToken"],["","ConstOne","tor_interface::tor_provider::CircuitToken"],["","ConstZero","tor_interface::tor_provider::CircuitToken"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","tor_interface::tor_provider::CircuitToken"],["","Debug","tor_interface::tor_provider::CircuitToken"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","tor_interface::tor_provider::CircuitToken"],["","Default","tor_interface::tor_provider::CircuitToken"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","tor_interface::tor_provider::CircuitToken"],["","Display","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Div<&usize>","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","tor_interface::tor_provider::CircuitToken"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","tor_interface::tor_provider::CircuitToken"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","tor_interface::tor_provider::CircuitToken"],["","FmtConst","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","tor_interface::tor_provider::CircuitToken"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","tor_interface::tor_provider::CircuitToken"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","tor_interface::tor_provider::CircuitToken"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","tor_interface::tor_provider::CircuitToken"],["","FromStr","tor_interface::tor_provider::CircuitToken"],["","FromZeroes","tor_interface::tor_provider::CircuitToken"],["","Fundamental","tor_interface::tor_provider::CircuitToken"],["","Hash","tor_interface::tor_provider::CircuitToken"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","tor_interface::tor_provider::CircuitToken"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","tor_interface::tor_provider::CircuitToken"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","tor_interface::tor_provider::CircuitToken"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","tor_interface::tor_provider::CircuitToken"],["","LowerExp","tor_interface::tor_provider::CircuitToken"],["","LowerHex","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Mul<&usize>","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","MulAdd","tor_interface::tor_provider::CircuitToken"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","tor_interface::tor_provider::CircuitToken"],["","Not","tor_interface::tor_provider::CircuitToken"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","tor_interface::tor_provider::CircuitToken"],["","NumCast","tor_interface::tor_provider::CircuitToken"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","tor_interface::tor_provider::CircuitToken"],["","Octal","tor_interface::tor_provider::CircuitToken"],["","One","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Ord for usize
","Ord","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingAdd for usize
","OverflowingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingMul for usize
","OverflowingMul","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingSub for usize
","OverflowingSub","tor_interface::tor_provider::CircuitToken"],["","ParseHex","tor_interface::tor_provider::CircuitToken"],["source§impl PartialEq<Value> for usize
","PartialEq","tor_interface::tor_provider::CircuitToken"],["","PartialEq","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","tor_interface::tor_provider::CircuitToken"],["","PhfBorrow","tor_interface::tor_provider::CircuitToken"],["","PhfHash","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u16>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u32>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u8>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","tor_interface::tor_provider::CircuitToken"],["","Product<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Product","tor_interface::tor_provider::CircuitToken"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Rem<&usize>","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","tor_interface::tor_provider::CircuitToken"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["source§impl Roots for usize
","Roots","tor_interface::tor_provider::CircuitToken"],["","RowIndex","tor_interface::tor_provider::CircuitToken"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","tor_interface::tor_provider::CircuitToken"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","tor_interface::tor_provider::CircuitToken"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","tor_interface::tor_provider::CircuitToken"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","tor_interface::tor_provider::CircuitToken"],["","Shl<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["","Shr<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["
Expand description
An enum representing a single bit
-impl Copy for SignBit
impl Freeze for SignBit
impl RefUnwindSafe for SignBit
impl Send for SignBit
impl Sync for SignBit
impl Unpin for SignBit
impl UnwindSafe for SignBit
Variants§
Trait Implementations§
impl Copy for SignBit
Auto Trait Implementations§
impl Freeze for SignBit
impl RefUnwindSafe for SignBit
impl Send for SignBit
impl Sync for SignBit
impl Unpin for SignBit
impl UnwindSafe for SignBit
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
fn implicit( diff --git a/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html b/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html index 415df0b0..d7f04cb7 100644 --- a/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html +++ b/crates/tor_interface/tor_crypto/struct.V3OnionServiceId.html @@ -16,7 +16,7 @@
sourcepub fn from_private_key(private_key: &Ed25519PrivateKey) -> V3OnionServiceId
pub fn from_private_key(private_key: &Ed25519PrivateKey) -> V3OnionServiceId
Create a V3OnionServiceId
from an Ed25519PrivateKey
.
source§impl Clone for V3OnionServiceId
impl Clone for V3OnionServiceId
source§fn clone(&self) -> V3OnionServiceId
fn clone(&self) -> V3OnionServiceId
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for V3OnionServiceId
impl Debug for V3OnionServiceId
source§impl Display for V3OnionServiceId
impl Display for V3OnionServiceId
source§impl Clone for V3OnionServiceId
impl Clone for V3OnionServiceId
source§fn clone(&self) -> V3OnionServiceId
fn clone(&self) -> V3OnionServiceId
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for V3OnionServiceId
impl Debug for V3OnionServiceId
source§impl Display for V3OnionServiceId
impl Display for V3OnionServiceId
source§impl Hash for V3OnionServiceId
impl Hash for V3OnionServiceId
source§impl Ord for V3OnionServiceId
impl Ord for V3OnionServiceId
source§fn cmp(&self, other: &V3OnionServiceId) -> Ordering
fn cmp(&self, other: &V3OnionServiceId) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/tor_interface/tor_provider/enum.OnionAddr.html b/crates/tor_interface/tor_provider/enum.OnionAddr.html
index 330e8dc7..212631b0 100644
--- a/crates/tor_interface/tor_provider/enum.OnionAddr.html
+++ b/crates/tor_interface/tor_provider/enum.OnionAddr.html
@@ -1,7 +1,7 @@
OnionAddr in tor_interface::tor_provider - Rust Enum tor_interface::tor_provider::OnionAddr
source · pub enum OnionAddr {
V3(OnionAddrV3),
}
Expand description
An onion service address analog to std::net::SocketAddr
-Variants§
§V3(OnionAddrV3)
Trait Implementations§
source§impl Hash for OnionAddr
1.3.0 · source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+
Variants§
§V3(OnionAddrV3)
Trait Implementations§
source§impl Ord for OnionAddr
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/tor_interface/tor_provider/struct.DomainAddr.html b/crates/tor_interface/tor_provider/struct.DomainAddr.html
index 9093e21e..c541ef98 100644
--- a/crates/tor_interface/tor_provider/struct.DomainAddr.html
+++ b/crates/tor_interface/tor_provider/struct.DomainAddr.html
@@ -3,7 +3,7 @@
Implementations§
Trait Implementations§
source§impl Clone for DomainAddr
source§fn clone(&self) -> DomainAddr
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for DomainAddr
source§impl Display for DomainAddr
source§impl FromStr for DomainAddr
Trait Implementations§
source§impl Clone for DomainAddr
source§fn clone(&self) -> DomainAddr
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for DomainAddr
source§impl Display for DomainAddr
source§impl FromStr for DomainAddr
source§impl Hash for DomainAddr
source§impl Ord for DomainAddr
source§fn cmp(&self, other: &DomainAddr) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/type.impl/std/primitive.usize.js b/crates/type.impl/std/primitive.usize.js
index da014e4e..ef01c053 100644
--- a/crates/type.impl/std/primitive.usize.js
+++ b/crates/type.impl/std/primitive.usize.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
-"gosling":[["","Accumulate","gosling::context::HandshakeHandle"],["","Add<&'a BigInt>","gosling::context::HandshakeHandle"],["","Add<&'a BigUint>","gosling::context::HandshakeHandle"],["","Add<&usize>","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","gosling::context::HandshakeHandle"],["","AsAny","gosling::context::HandshakeHandle"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["","Binary","gosling::context::HandshakeHandle"],["","BitAnd<&usize>","gosling::context::HandshakeHandle"],["","BitAnd","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","gosling::context::HandshakeHandle"],["","BitOr<&usize>","gosling::context::HandshakeHandle"],["","BitOr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","gosling::context::HandshakeHandle"],["","BitRegister","gosling::context::HandshakeHandle"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","gosling::context::HandshakeHandle"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","gosling::context::HandshakeHandle"],["","BitXor<&usize>","gosling::context::HandshakeHandle"],["","BitXor","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","gosling::context::HandshakeHandle"],["","Bits","gosling::context::HandshakeHandle"],["","Bounded","gosling::context::HandshakeHandle"],["","CastSigned","gosling::context::HandshakeHandle"],["","CastUnsigned","gosling::context::HandshakeHandle"],["source§impl CheckedAdd for usize
","CheckedAdd","gosling::context::HandshakeHandle"],["source§impl CheckedDiv for usize
","CheckedDiv","gosling::context::HandshakeHandle"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","gosling::context::HandshakeHandle"],["source§impl CheckedMul for usize
","CheckedMul","gosling::context::HandshakeHandle"],["source§impl CheckedNeg for usize
","CheckedNeg","gosling::context::HandshakeHandle"],["source§impl CheckedRem for usize
","CheckedRem","gosling::context::HandshakeHandle"],["source§impl CheckedShl for usize
","CheckedShl","gosling::context::HandshakeHandle"],["source§impl CheckedShr for usize
","CheckedShr","gosling::context::HandshakeHandle"],["source§impl CheckedSub for usize
","CheckedSub","gosling::context::HandshakeHandle"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","gosling::context::HandshakeHandle"],["","Clone","gosling::context::HandshakeHandle"],["","ConstOne","gosling::context::HandshakeHandle"],["","ConstZero","gosling::context::HandshakeHandle"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","gosling::context::HandshakeHandle"],["","Debug","gosling::context::HandshakeHandle"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","gosling::context::HandshakeHandle"],["","Default","gosling::context::HandshakeHandle"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","gosling::context::HandshakeHandle"],["","Display","gosling::context::HandshakeHandle"],["","Div<&'a BigInt>","gosling::context::HandshakeHandle"],["","Div<&'a BigUint>","gosling::context::HandshakeHandle"],["","Div<&usize>","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","gosling::context::HandshakeHandle"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","gosling::context::HandshakeHandle"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","gosling::context::HandshakeHandle"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","gosling::context::HandshakeHandle"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","gosling::context::HandshakeHandle"],["","FmtConst","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","gosling::context::HandshakeHandle"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","gosling::context::HandshakeHandle"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","gosling::context::HandshakeHandle"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","gosling::context::HandshakeHandle"],["","FromStr","gosling::context::HandshakeHandle"],["","FromZeroes","gosling::context::HandshakeHandle"],["","Fundamental","gosling::context::HandshakeHandle"],["","Hash","gosling::context::HandshakeHandle"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","gosling::context::HandshakeHandle"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","gosling::context::HandshakeHandle"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","gosling::context::HandshakeHandle"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","gosling::context::HandshakeHandle"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","gosling::context::HandshakeHandle"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","gosling::context::HandshakeHandle"],["","LowerExp","gosling::context::HandshakeHandle"],["","LowerHex","gosling::context::HandshakeHandle"],["","Mul<&'a BigInt>","gosling::context::HandshakeHandle"],["","Mul<&'a BigUint>","gosling::context::HandshakeHandle"],["","Mul<&usize>","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","MulAdd","gosling::context::HandshakeHandle"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","gosling::context::HandshakeHandle"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","gosling::context::HandshakeHandle"],["","Not","gosling::context::HandshakeHandle"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","gosling::context::HandshakeHandle"],["","NumCast","gosling::context::HandshakeHandle"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","gosling::context::HandshakeHandle"],["","Octal","gosling::context::HandshakeHandle"],["","One","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Ord for usize
","Ord","gosling::context::HandshakeHandle"],["source§impl OverflowingAdd for usize
","OverflowingAdd","gosling::context::HandshakeHandle"],["source§impl OverflowingMul for usize
","OverflowingMul","gosling::context::HandshakeHandle"],["source§impl OverflowingSub for usize
","OverflowingSub","gosling::context::HandshakeHandle"],["","ParseHex","gosling::context::HandshakeHandle"],["source§impl PartialEq<Value> for usize
","PartialEq","gosling::context::HandshakeHandle"],["","PartialEq","gosling::context::HandshakeHandle"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","gosling::context::HandshakeHandle"],["","PhfBorrow","gosling::context::HandshakeHandle"],["","PhfHash","gosling::context::HandshakeHandle"],["","Pow<&'a u16>","gosling::context::HandshakeHandle"],["","Pow<&'a u32>","gosling::context::HandshakeHandle"],["","Pow<&'a u8>","gosling::context::HandshakeHandle"],["","Pow<&'a usize>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","gosling::context::HandshakeHandle"],["","Product<&'a usize>","gosling::context::HandshakeHandle"],["","Product","gosling::context::HandshakeHandle"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","gosling::context::HandshakeHandle"],["","Rem<&'a BigInt>","gosling::context::HandshakeHandle"],["","Rem<&'a BigUint>","gosling::context::HandshakeHandle"],["","Rem<&usize>","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","gosling::context::HandshakeHandle"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","gosling::context::HandshakeHandle"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["source§impl Roots for usize
","Roots","gosling::context::HandshakeHandle"],["","RowIndex","gosling::context::HandshakeHandle"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","gosling::context::HandshakeHandle"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","gosling::context::HandshakeHandle"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","gosling::context::HandshakeHandle"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","gosling::context::HandshakeHandle"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","gosling::context::HandshakeHandle"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","gosling::context::HandshakeHandle"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","gosling::context::HandshakeHandle"],["","Shl<&i128>","gosling::context::HandshakeHandle"],["","Shl<&i16>","gosling::context::HandshakeHandle"],["","Shl<&i32>","gosling::context::HandshakeHandle"],["","Shl<&i64>","gosling::context::HandshakeHandle"],["","Shl<&i8>","gosling::context::HandshakeHandle"],["","Shl<&isize>","gosling::context::HandshakeHandle"],["","Shl<&u128>","gosling::context::HandshakeHandle"],["","Shl<&u16>","gosling::context::HandshakeHandle"],["","Shl<&u32>","gosling::context::HandshakeHandle"],["","Shl<&u64>","gosling::context::HandshakeHandle"],["","Shl<&u8>","gosling::context::HandshakeHandle"],["","Shl<&usize>","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["","Shr<&i128>","gosling::context::HandshakeHandle"],["","Shr<&i16>","gosling::context::HandshakeHandle"],["","Shr<&i32>","gosling::context::HandshakeHandle"],["","Shr<&i64>","gosling::context::HandshakeHandle"],["","Shr<&i8>","gosling::context::HandshakeHandle"],["","Shr<&isize>","gosling::context::HandshakeHandle"],["","Shr<&u128>","gosling::context::HandshakeHandle"],["","Shr<&u16>","gosling::context::HandshakeHandle"],["","Shr<&u32>","gosling::context::HandshakeHandle"],["","Shr<&u64>","gosling::context::HandshakeHandle"],["","Shr<&u8>","gosling::context::HandshakeHandle"],["","Shr<&usize>","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i128> for usize
source§fn shr_assign(&mut self, other: &i128)
Performs the >>=
operation. Read more","ShrAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i16> for usize
source§fn shr_assign(&mut self, other: &i16)
Performs the >>=
operation. Read more","ShrAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i32> for usize
source§fn shr_assign(&mut self, other: &i32)
Performs the >>=
operation. Read more","ShrAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i64> for usize
source§fn shr_assign(&mut self, other: &i64)
Performs the >>=
operation. Read more","ShrAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i8> for usize
source§fn shr_assign(&mut self, other: &i8)
Performs the >>=
operation. Read more","ShrAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&isize> for usize
source§fn shr_assign(&mut self, other: &isize)
Performs the >>=
operation. Read more","ShrAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u128> for usize
source§fn shr_assign(&mut self, other: &u128)
Performs the >>=
operation. Read more","ShrAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u16> for usize
source§fn shr_assign(&mut self, other: &u16)
Performs the >>=
operation. Read more","ShrAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u32> for usize
source§fn shr_assign(&mut self, other: &u32)
Performs the >>=
operation. Read more","ShrAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u64> for usize
source§fn shr_assign(&mut self, other: &u64)
Performs the >>=
operation. Read more","ShrAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u8> for usize
source§fn shr_assign(&mut self, other: &u8)
Performs the >>=
operation. Read more","ShrAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&usize> for usize
source§fn shr_assign(&mut self, other: &usize)
Performs the >>=
operation. Read more","ShrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i128> for usize
source§fn shr_assign(&mut self, other: i128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i16> for usize
source§fn shr_assign(&mut self, other: i16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i32> for usize
source§fn shr_assign(&mut self, other: i32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i64> for usize
source§fn shr_assign(&mut self, other: i64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i8> for usize
source§fn shr_assign(&mut self, other: i8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<isize> for usize
source§fn shr_assign(&mut self, other: isize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u128> for usize
source§fn shr_assign(&mut self, other: u128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u16> for usize
source§fn shr_assign(&mut self, other: u16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u32> for usize
source§fn shr_assign(&mut self, other: u32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u64> for usize
source§fn shr_assign(&mut self, other: u64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u8> for usize
source§fn shr_assign(&mut self, other: u8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign for usize
source§fn shr_assign(&mut self, other: usize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["source§impl SimdElement for usize
","SimdElement","gosling::context::HandshakeHandle"],["1.15.0 (const: unstable) · source§impl<T> SliceIndex<[T]> for usize
The methods index
and index_mut
panic if the index is out of bounds.
\nsource§fn get(self, slice: &[T]) -> Option<&T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a shared reference to the output at this location, if in\nbounds.source§fn get_mut(self, slice: &mut [T]) -> Option<&mut T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable reference to the output at this location, if in\nbounds.source§unsafe fn get_unchecked(self, slice: *const [T]) -> *const T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.source§unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.","SliceIndex<[T]>","gosling::context::HandshakeHandle"],["§impl SmartDisplay for usize
§fn metadata(&self, f: FormatterOptions) -> Metadata<'_, usize>
Compute any information needed to format the value. This must, at a minimum, determine the\nwidth of the value before any padding is added by the formatter. Read more§fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Format the value using the given formatter. This is the same as Display::fmt
. Read more§fn fmt_with_metadata(\n &self,\n f: &mut Formatter<'_>,\n _metadata: Metadata<'_, Self>,\n) -> Result<(), Error>
Format the value using the given formatter and metadata. The formatted output should have\nthe width indicated by the metadata. This is before any padding is added by the\nformatter. Read more","SmartDisplay","gosling::context::HandshakeHandle"],["source§impl Step for usize
source§fn forward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn backward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn forward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn backward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn steps_between(start: &usize, end: &usize) -> Option<usize>
🔬This is a nightly-only experimental API. (step_trait
)","Step","gosling::context::HandshakeHandle"],["","Sub<&'a BigInt>","gosling::context::HandshakeHandle"],["","Sub<&'a BigUint>","gosling::context::HandshakeHandle"],["","Sub<&usize>","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["1.22.0 · source§impl SubAssign<&usize> for usize
source§fn sub_assign(&mut self, other: &usize)
Performs the -=
operation. Read more","SubAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl SubAssign for usize
source§fn sub_assign(&mut self, other: usize)
Performs the -=
operation. Read more","SubAssign","gosling::context::HandshakeHandle"],["","Sum<&'a usize>","gosling::context::HandshakeHandle"],["","Sum","gosling::context::HandshakeHandle"],["","ToBigInt","gosling::context::HandshakeHandle"],["source§impl ToBigUint for usize
source§fn to_biguint(&self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","ToBigUint","gosling::context::HandshakeHandle"],["source§impl ToBytes for usize
§type Bytes = [u8; 8]
source§fn to_be_bytes(&self) -> <usize as ToBytes>::Bytes
Return the memory representation of this number as a byte array in big-endian byte order. Read more","ToBytes","gosling::context::HandshakeHandle"],["source§impl ToPrimitive for usize
source§fn to_isize(&self) -> Option<isize>
Converts the value of self
to an isize
. If the value cannot be\nrepresented by an isize
, then None
is returned.source§fn to_i8(&self) -> Option<i8>
Converts the value of self
to an i8
. If the value cannot be\nrepresented by an i8
, then None
is returned.source§fn to_i16(&self) -> Option<i16>
Converts the value of self
to an i16
. If the value cannot be\nrepresented by an i16
, then None
is returned.source§fn to_i32(&self) -> Option<i32>
Converts the value of self
to an i32
. If the value cannot be\nrepresented by an i32
, then None
is returned.source§fn to_i64(&self) -> Option<i64>
Converts the value of self
to an i64
. If the value cannot be\nrepresented by an i64
, then None
is returned.source§fn to_i128(&self) -> Option<i128>
Converts the value of self
to an i128
. If the value cannot be\nrepresented by an i128
(i64
under the default implementation), then\nNone
is returned. Read moresource§fn to_usize(&self) -> Option<usize>
Converts the value of self
to a usize
. If the value cannot be\nrepresented by a usize
, then None
is returned.source§fn to_u8(&self) -> Option<u8>
Converts the value of self
to a u8
. If the value cannot be\nrepresented by a u8
, then None
is returned.source§fn to_u16(&self) -> Option<u16>
Converts the value of self
to a u16
. If the value cannot be\nrepresented by a u16
, then None
is returned.source§fn to_u32(&self) -> Option<u32>
Converts the value of self
to a u32
. If the value cannot be\nrepresented by a u32
, then None
is returned.source§fn to_u64(&self) -> Option<u64>
Converts the value of self
to a u64
. If the value cannot be\nrepresented by a u64
, then None
is returned.source§fn to_u128(&self) -> Option<u128>
Converts the value of self
to a u128
. If the value cannot be\nrepresented by a u128
(u64
under the default implementation), then\nNone
is returned. Read more","ToPrimitive","gosling::context::HandshakeHandle"],["","ToSql","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","TryFrom>","gosling::context::HandshakeHandle"],["","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i128> for usize
source§fn try_from(u: i128) -> Result<usize, <usize as TryFrom<i128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i16> for usize
source§fn try_from(u: i16) -> Result<usize, <usize as TryFrom<i16>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i32> for usize
source§fn try_from(u: i32) -> Result<usize, <usize as TryFrom<i32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i64> for usize
source§fn try_from(u: i64) -> Result<usize, <usize as TryFrom<i64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i8> for usize
source§fn try_from(u: i8) -> Result<usize, <usize as TryFrom<i8>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<isize> for usize
source§fn try_from(u: isize) -> Result<usize, <usize as TryFrom<isize>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u128> for usize
source§fn try_from(u: u128) -> Result<usize, <usize as TryFrom<u128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u32> for usize
source§fn try_from(value: u32) -> Result<usize, <usize as TryFrom<u32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u64> for usize
source§fn try_from(value: u64) -> Result<usize, <usize as TryFrom<u64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["§impl Unsigned for usize
§fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.§fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
. Read more§fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to n
. If the\nnext power of two is greater than the type’s maximum value, None
is\nreturned, otherwise the power of two is wrapped in Some
.","Unsigned","gosling::context::HandshakeHandle"],["","UpperExp","gosling::context::HandshakeHandle"],["","UpperHex","gosling::context::HandshakeHandle"],["","Value","gosling::context::HandshakeHandle"],["source§impl WrappingAdd for usize
source§fn wrapping_add(&self, v: &usize) -> usize
Wrapping (modular) addition. Computes self + other
, wrapping around at the boundary of\nthe type.","WrappingAdd","gosling::context::HandshakeHandle"],["source§impl WrappingMul for usize
source§fn wrapping_mul(&self, v: &usize) -> usize
Wrapping (modular) multiplication. Computes self * other
, wrapping around at the boundary\nof the type.","WrappingMul","gosling::context::HandshakeHandle"],["source§impl WrappingNeg for usize
source§fn wrapping_neg(&self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type. Read more","WrappingNeg","gosling::context::HandshakeHandle"],["source§impl WrappingShl for usize
","WrappingShl","gosling::context::HandshakeHandle"],["source§impl WrappingShr for usize
","WrappingShr","gosling::context::HandshakeHandle"],["source§impl WrappingSub for usize
source§fn wrapping_sub(&self, v: &usize) -> usize
Wrapping (modular) subtraction. Computes self - other
, wrapping around at the boundary\nof the type.","WrappingSub","gosling::context::HandshakeHandle"],["","WriteHex","gosling::context::HandshakeHandle"],["§impl Writeable for usize
§fn write_to<W>(&self, sink: &mut W) -> Result<(), Error>
Writes a string to the given sink. Errors from the sink are bubbled up.\nThe default implementation delegates to write_to_parts
, and discards any\nPart
annotations.§fn writeable_length_hint(&self) -> LengthHint
Returns a hint for the number of UTF-8 bytes that will be written to the sink. Read more§fn write_to_parts<S>(&self, sink: &mut S) -> Result<(), Error>where\n S: PartsWrite + ?Sized,
Write bytes and Part
annotations to the given sink. Errors from the\nsink are bubbled up. The default implementation delegates to write_to
,\nand doesn’t produce any Part
annotations.§fn write_to_string(&self) -> Cow<'_, str>
Creates a new String
with the data from this Writeable
. Like ToString
,\nbut smaller and faster. Read more§fn writeable_cmp_bytes(&self, other: &[u8]) -> Ordering
Compares the contents of this Writeable
to the given bytes\nwithout allocating a String to hold the Writeable
contents. Read more","Writeable","gosling::context::HandshakeHandle"],["§impl<'a> Yokeable<'a> for usize
§fn transform_owned(self) -> <usize as Yokeable<'a>>::Output
§unsafe fn make(this: <usize as Yokeable<'a>>::Output) -> usize
This method can be used to cast away Self<'a>
’s lifetime. Read more§fn transform_mut<F>(&'a mut self, f: F)
This method must cast self
between &'a mut Self<'static>
and &'a mut Self<'a>
,\nand pass it to f
. Read more","Yokeable<'a>","gosling::context::HandshakeHandle"],["","Zero","gosling::context::HandshakeHandle"],["","ZeroFrom<'a, usize>","gosling::context::HandshakeHandle"],["§impl<'a> ZeroMapKV<'a> for usize
","ZeroMapKV<'a>","gosling::context::HandshakeHandle"],["source§impl usize
1.43.0 · sourcepub const MIN: usize = 0usize
The smallest value that can be represented by this integer type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MIN, 0);
\n1.43.0 · sourcepub const MAX: usize = 18_446_744_073_709_551_615usize
The largest value that can be represented by this integer type\n(264 − 1 on 64-bit targets).
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX, 18446744073709551615);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b01001100usize;\n\nassert_eq!(n.count_ones(), 3);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX.count_zeros(), 0);
\n1.0.0 (const: 1.32.0) · sourcepub const fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of self
.
\nDepending on what you’re doing with the value, you might also be interested in the\nilog2
function which returns a consistent number, even if the type widens.
\n§Examples
\nBasic usage:
\n\nlet n = usize::MAX >> 2;\n\nassert_eq!(n.leading_zeros(), 2);
\n1.0.0 (const: 1.32.0) · sourcepub const fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b0101000usize;\n\nassert_eq!(n.trailing_zeros(), 3);
\n1.46.0 (const: 1.46.0) · sourcepub const fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = !(usize::MAX >> 2);\n\nassert_eq!(n.leading_ones(), 2);
\n1.46.0 (const: 1.46.0) · sourcepub const fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b1010111usize;\n\nassert_eq!(n.trailing_ones(), 3);
\nsourcepub const fn cast_signed(self) -> isize
🔬This is a nightly-only experimental API. (integer_sign_cast
)
Returns the bit pattern of self
reinterpreted as a signed integer of the same size.
\nThis produces the same result as an as
cast, but ensures that the bit-width remains\nthe same.
\n§Examples
\nBasic usage:
\n\n#![feature(integer_sign_cast)]\n\nlet n = usize::MAX;\n\nassert_eq!(n.cast_signed(), -1isize);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
,\nwrapping the truncated bits to the end of the resulting integer.
\nPlease note this isn’t the same operation as the <<
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0xaa00000000006e1usize;\nlet m = 0x6e10aa;\n\nassert_eq!(n.rotate_left(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
,\nwrapping the truncated bits to the beginning of the resulting\ninteger.
\nPlease note this isn’t the same operation as the >>
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0x6e10aausize;\nlet m = 0xaa00000000006e1;\n\nassert_eq!(n.rotate_right(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn swap_bytes(self) -> usize
Reverses the byte order of the integer.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.swap_bytes();\n\nassert_eq!(m, 0x5634129078563412);
\n1.37.0 (const: 1.37.0) · sourcepub const fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit,\nsecond least-significant bit becomes second most-significant bit, etc.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.reverse_bits();\n\nassert_eq!(m, 0x6a2c48091e6a2c48);\nassert_eq!(0, 0usize.reverse_bits());
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_be(x: usize) -> usize
Converts an integer from big endian to the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(usize::from_be(n), n)\n} else {\n assert_eq!(usize::from_be(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_le(x: usize) -> usize
Converts an integer from little endian to the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(usize::from_le(n), n)\n} else {\n assert_eq!(usize::from_le(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_be(self) -> usize
Converts self
to big endian from the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(n.to_be(), n)\n} else {\n assert_eq!(n.to_be(), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_le(self) -> usize
Converts self
to little endian from the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(n.to_le(), n)\n} else {\n assert_eq!(n.to_le(), n.swap_bytes())\n}
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
\nif overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!((usize::MAX - 2).checked_add(1), Some(usize::MAX - 1));\nassert_eq!((usize::MAX - 2).checked_add(3), None);
\nsourcepub const fn strict_add(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer addition. Computes self + rhs
, panicking\nif overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!((usize::MAX - 2).strict_add(1), usize::MAX - 1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add(3);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_add(self, rhs: usize) -> usize
Unchecked integer addition. Computes self + rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_add(y)
is semantically equivalent to calling\nx.
checked_add
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_add
.
\n§Safety
\nThis results in undefined behavior when\nself + rhs > usize::MAX
or self + rhs < usize::MIN
,\ni.e. when checked_add
would return None
.
\n1.66.0 (const: 1.66.0) · sourcepub const fn checked_add_signed(self, rhs: isize) -> Option<usize>
Checked addition with a signed integer. Computes self + rhs
,\nreturning None
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_add_signed(2), Some(3));\nassert_eq!(1usize.checked_add_signed(-2), None);\nassert_eq!((usize::MAX - 2).checked_add_signed(3), None);
\nsourcepub const fn strict_add_signed(self, rhs: isize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict addition with a signed integer. Computes self + rhs
,\npanicking if overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_add_signed(2), 3);
\nThe following panic because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_add_signed(-2);
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add_signed(3);
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_sub(1), Some(0));\nassert_eq!(0usize.checked_sub(1), None);
\nsourcepub const fn strict_sub(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer subtraction. Computes self - rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_sub(1), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0usize.strict_sub(1);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_sub(self, rhs: usize) -> usize
Unchecked integer subtraction. Computes self - rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_sub(y)
is semantically equivalent to calling\nx.
checked_sub
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_sub
.
\nIf you find yourself writing code like this:
\n\nif foo >= bar {\n // SAFETY: just checked it will not overflow\n let diff = unsafe { foo.unchecked_sub(bar) };\n // ... use diff ...\n}
\nConsider changing it to
\n\nif let Some(diff) = foo.checked_sub(bar) {\n // ... use diff ...\n}
\nAs that does exactly the same thing – including telling the optimizer\nthat the subtraction cannot overflow – but avoids needing unsafe
.
\n§Safety
\nThis results in undefined behavior when\nself - rhs > usize::MAX
or self - rhs < usize::MIN
,\ni.e. when checked_sub
would return None
.
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_mul(1), Some(5));\nassert_eq!(usize::MAX.checked_mul(2), None);
\nsourcepub const fn strict_mul(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer multiplication. Computes self * rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(5usize.strict_mul(1), 5);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_mul(2);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_mul(self, rhs: usize) -> usize
Unchecked integer multiplication. Computes self * rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_mul(y)
is semantically equivalent to calling\nx.
checked_mul
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_mul
.
\n§Safety
\nThis results in undefined behavior when\nself * rhs > usize::MAX
or self * rhs < usize::MIN
,\ni.e. when checked_mul
would return None
.
\n1.0.0 (const: 1.52.0) · sourcepub const fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div(2), Some(64));\nassert_eq!(1usize.checked_div(0), None);
\nsourcepub const fn strict_div(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer division. Computes self / rhs
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div_euclid(2), Some(64));\nassert_eq!(1usize.checked_div_euclid(0), None);
\nsourcepub const fn strict_div_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean division. Computes self.div_euclid(rhs)
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div_euclid(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div_euclid(0);
\n1.7.0 (const: 1.52.0) · sourcepub const fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem(2), Some(1));\nassert_eq!(5usize.checked_rem(0), None);
\nsourcepub const fn strict_rem(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer remainder. Computes self % rhs
.\nStrict remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean modulo. Computes self.rem_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem_euclid(2), Some(1));\nassert_eq!(5usize.checked_rem_euclid(0), None);
\nsourcepub const fn strict_rem_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean modulo. Computes self.rem_euclid(rhs)
.\nStrict modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem_euclid(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem_euclid(0);
\n1.67.0 (const: 1.67.0) · sourcepub const fn ilog(self, base: usize) -> u32
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nThis method might not be optimized owing to implementation details;\nilog2
can produce results more efficiently for base 2, and ilog10
\ncan produce results more efficiently for base 10.
\n§Panics
\nThis function will panic if self
is zero, or if base
is less than 2.
\n§Examples
\nassert_eq!(5usize.ilog(5), 1);
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog(self, base: usize) -> Option<u32>
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nReturns None
if the number is zero, or if the base is not at least 2.
\nThis method might not be optimized owing to implementation details;\nchecked_ilog2
can produce results more efficiently for base 2, and\nchecked_ilog10
can produce results more efficiently for base 10.
\n§Examples
\nassert_eq!(5usize.checked_ilog(5), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog2(self) -> Option<u32>
Returns the base 2 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(2usize.checked_ilog2(), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog10(self) -> Option<u32>
Returns the base 10 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(10usize.checked_ilog10(), Some(1));
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_neg(self) -> Option<usize>
Checked negation. Computes -self
, returning None
unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0usize.checked_neg(), Some(0));\nassert_eq!(1usize.checked_neg(), None);
\nsourcepub const fn strict_neg(self) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict negation. Computes -self
, panicking unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0usize.strict_neg(), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_neg();
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x1usize.checked_shl(4), Some(0x10));\nassert_eq!(0x10usize.checked_shl(129), None);
\nsourcepub const fn strict_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift left. Computes self << rhs
, panicking if rhs
is larger\nthan or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x1usize.strict_shl(4), 0x10);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shl(129);
\nsourcepub const unsafe fn unchecked_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift left. Computes self << rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shl
would return None
.
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x10usize.checked_shr(4), Some(0x1));\nassert_eq!(0x10usize.checked_shr(129), None);
\nsourcepub const fn strict_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift right. Computes self >> rhs
, panicking rhs
is\nlarger than or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x10usize.strict_shr(4), 0x1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shr(129);
\nsourcepub const unsafe fn unchecked_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift right. Computes self >> rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shr
would return None
.
\n1.34.0 (const: 1.50.0) · sourcepub const fn checked_pow(self, exp: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_pow(5), Some(32));\nassert_eq!(usize::MAX.checked_pow(2), None);
\nsourcepub const fn strict_pow(self, exp: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict exponentiation. Computes self.pow(exp)
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(2usize.strict_pow(5), 32);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_pow(2);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at\nthe numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_add(1), 101);\nassert_eq!(usize::MAX.saturating_add(127), usize::MAX);
\n1.66.0 (const: 1.66.0) · sourcepub const fn saturating_add_signed(self, rhs: isize) -> usize
Saturating addition with a signed integer. Computes self + rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.saturating_add_signed(2), 3);\nassert_eq!(1usize.saturating_add_signed(-2), 0);\nassert_eq!((usize::MAX - 2).saturating_add_signed(4), usize::MAX);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating\nat the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_sub(27), 73);\nassert_eq!(13usize.saturating_sub(127), 0);
\n1.7.0 (const: 1.47.0) · sourcepub const fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.saturating_mul(10), 20);\nassert_eq!((usize::MAX).saturating_mul(10), usize::MAX);
\n1.58.0 (const: 1.58.0) · sourcepub const fn saturating_div(self, rhs: usize) -> usize
1.34.0 (const: 1.50.0) · sourcepub const fn saturating_pow(self, exp: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(4usize.saturating_pow(3), 64);\nassert_eq!(usize::MAX.saturating_pow(2), usize::MAX);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(200usize.wrapping_add(55), 255);\nassert_eq!(200usize.wrapping_add(usize::MAX), 199);
\n1.66.0 (const: 1.66.0) · sourcepub const fn wrapping_add_signed(self, rhs: isize) -> usize
Wrapping (modular) addition with a signed integer. Computes\nself + rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_add_signed(2), 3);\nassert_eq!(1usize.wrapping_add_signed(-2), usize::MAX);\nassert_eq!((usize::MAX - 2).wrapping_add_signed(4), 1);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_sub(100), 0);\nassert_eq!(100usize.wrapping_sub(usize::MAX), 101);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u8
is used here.
\n\nassert_eq!(10u8.wrapping_mul(12), 120);\nassert_eq!(25u8.wrapping_mul(12), 44);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div(10), 10);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div_euclid(10), 10);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
.\nWrapped remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem(10), 0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean modulo. Computes self.rem_euclid(rhs)
.\nWrapped modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem_euclid(10), 0);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type.
\nSince unsigned types do not have negative equivalents\nall applications of this function will wrap (except for -0
).\nFor values smaller than the corresponding signed type’s maximum\nthe result is the same as casting the corresponding signed value.\nAny larger values are equivalent to MAX + 1 - (val - MAX - 1)
where\nMAX
is the corresponding signed type’s maximum.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0_usize.wrapping_neg(), 0);\nassert_eq!(usize::MAX.wrapping_neg(), 1);\nassert_eq!(13_usize.wrapping_neg(), (!13) + 1);\nassert_eq!(42_usize.wrapping_neg(), !(42 - 1));
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-left; the\nRHS of a wrapping shift-left is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_left
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_shl(7), 128);\nassert_eq!(1usize.wrapping_shl(128), 1);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-right; the\nRHS of a wrapping shift-right is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_right
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.wrapping_shr(7), 1);\nassert_eq!(128usize.wrapping_shr(128), 128);
\n1.34.0 (const: 1.50.0) · sourcepub const fn wrapping_pow(self, exp: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.wrapping_pow(5), 243);\nassert_eq!(3u8.wrapping_pow(6), 217);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_add(self, rhs: usize) -> (usize, bool)
Calculates self
+ rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_add(2), (7, false));\nassert_eq!(usize::MAX.overflowing_add(1), (0, true));
\nsourcepub const fn carrying_add(self, rhs: usize, carry: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
+ rhs
+ carry
and returns a tuple containing\nthe sum and the output carry.
\nPerforms “ternary addition” of two integer operands and a carry-in\nbit, and returns an output integer and a carry-out bit. This allows\nchaining together multiple additions to create a wider addition, and\ncan be useful for bignum addition.
\nThis can be thought of as a 64-bit “full adder”, in the electronics sense.
\nIf the input carry is false, this method is equivalent to\noverflowing_add
, and the output carry is\nequal to the overflow flag. Note that although carry and overflow\nflags are similar for unsigned integers, they are different for\nsigned integers.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 3 MAX (a = 3 × 2^64 + 2^64 - 1)\n// + 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 9 6 (sum = 9 × 2^64 + 6)\n\nlet (a1, a0): (usize, usize) = (3, usize::MAX);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet carry0 = false;\n\nlet (sum0, carry1) = a0.carrying_add(b0, carry0);\nassert_eq!(carry1, true);\nlet (sum1, carry2) = a1.carrying_add(b1, carry1);\nassert_eq!(carry2, false);\n\nassert_eq!((sum1, sum0), (9, 6));
\n1.66.0 (const: 1.66.0) · sourcepub const fn overflowing_add_signed(self, rhs: isize) -> (usize, bool)
Calculates self
+ rhs
with a signed rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.overflowing_add_signed(2), (3, false));\nassert_eq!(1usize.overflowing_add_signed(-2), (usize::MAX, true));\nassert_eq!((usize::MAX - 2).overflowing_add_signed(4), (1, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_sub(self, rhs: usize) -> (usize, bool)
Calculates self
- rhs
\nReturns a tuple of the subtraction along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_sub(2), (3, false));\nassert_eq!(0usize.overflowing_sub(1), (usize::MAX, true));
\nsourcepub const fn borrowing_sub(self, rhs: usize, borrow: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
− rhs
− borrow
and returns a tuple\ncontaining the difference and the output borrow.
\nPerforms “ternary subtraction” by subtracting both an integer\noperand and a borrow-in bit from self
, and returns an output\ninteger and a borrow-out bit. This allows chaining together multiple\nsubtractions to create a wider subtraction, and can be useful for\nbignum subtraction.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 9 6 (a = 9 × 2^64 + 6)\n// - 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 3 MAX (diff = 3 × 2^64 + 2^64 - 1)\n\nlet (a1, a0): (usize, usize) = (9, 6);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet borrow0 = false;\n\nlet (diff0, borrow1) = a0.borrowing_sub(b0, borrow0);\nassert_eq!(borrow1, true);\nlet (diff1, borrow2) = a1.borrowing_sub(b1, borrow1);\nassert_eq!(borrow2, false);\n\nassert_eq!((diff1, diff0), (3, usize::MAX));
\n1.60.0 (const: 1.60.0) · sourcepub const fn abs_diff(self, other: usize) -> usize
Computes the absolute difference between self
and other
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.abs_diff(80), 20usize);\nassert_eq!(100usize.abs_diff(110), 10usize);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_mul(self, rhs: usize) -> (usize, bool)
Calculates the multiplication of self
and rhs
.
\nReturns a tuple of the multiplication along with a boolean\nindicating whether an arithmetic overflow would occur. If an\noverflow would have occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\nassert_eq!(5u32.overflowing_mul(2), (10, false));\nassert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_div(self, rhs: usize) -> (usize, bool)
Calculates the divisor when self
is divided by rhs
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div(2), (2, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.overflowing_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div_euclid(2), (2, false));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_rem(self, rhs: usize) -> (usize, bool)
Calculates the remainder when self
is divided by rhs
.
\nReturns a tuple of the remainder after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem(2), (1, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Calculates the remainder self.rem_euclid(rhs)
as if by Euclidean division.
\nReturns a tuple of the modulo after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this operation\nis exactly equal to self.overflowing_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem_euclid(2), (1, false));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_neg(self) -> (usize, bool)
Negates self in an overflowing fashion.
\nReturns !self + 1
using wrapping operations to return the value\nthat represents the negation of this unsigned value. Note that for\npositive unsigned values overflow always occurs, but negating 0 does\nnot overflow.
\n§Examples
\nBasic usage
\n\nassert_eq!(0usize.overflowing_neg(), (0, false));\nassert_eq!(2usize.overflowing_neg(), (-2i32 as usize, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shl(self, rhs: u32) -> (usize, bool)
Shifts self left by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x1usize.overflowing_shl(4), (0x10, false));\nassert_eq!(0x1usize.overflowing_shl(132), (0x10, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shr(self, rhs: u32) -> (usize, bool)
Shifts self right by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x10usize.overflowing_shr(4), (0x1, false));\nassert_eq!(0x10usize.overflowing_shr(132), (0x1, true));
\n1.34.0 (const: 1.50.0) · sourcepub const fn overflowing_pow(self, exp: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring.
\nReturns a tuple of the exponentiation along with a bool indicating\nwhether an overflow happened.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.overflowing_pow(5), (243, false));\nassert_eq!(3u8.overflowing_pow(6), (217, true));
\n1.0.0 (const: 1.50.0) · sourcepub const fn pow(self, exp: u32) -> usize
Raises self to the power of exp
, using exponentiation by squaring.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.pow(5), 32);
\nsourcepub const fn isqrt(self) -> usize
🔬This is a nightly-only experimental API. (isqrt
)
Returns the square root of the number, rounded down.
\n§Examples
\nBasic usage:
\n\n#![feature(isqrt)]\nassert_eq!(10usize.isqrt(), 3);
\n1.38.0 (const: 1.52.0) · sourcepub const fn div_euclid(self, rhs: usize) -> usize
1.38.0 (const: 1.52.0) · sourcepub const fn rem_euclid(self, rhs: usize) -> usize
Calculates the least remainder of self (mod rhs)
.
\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self % rhs
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(7usize.rem_euclid(4), 3); // or any other integer type
\nsourcepub const fn div_floor(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (int_roundings
)
Calculates the quotient of self
and rhs
, rounding the result towards negative infinity.
\nThis is the same as performing self / rhs
for all unsigned integers.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(int_roundings)]\nassert_eq!(7_usize.div_floor(4), 1);
\n1.73.0 (const: 1.73.0) · sourcepub const fn next_multiple_of(self, rhs: usize) -> usize
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Overflow behavior
\nOn overflow, this function will panic if overflow checks are enabled (default in debug\nmode) and wrap if overflow checks are disabled (default in release mode).
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.next_multiple_of(8), 16);\nassert_eq!(23_usize.next_multiple_of(8), 24);
\n1.73.0 (const: 1.73.0) · sourcepub const fn checked_next_multiple_of(self, rhs: usize) -> Option<usize>
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
. Returns None
if rhs
is zero or the\noperation would result in overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.checked_next_multiple_of(8), Some(16));\nassert_eq!(23_usize.checked_next_multiple_of(8), Some(24));\nassert_eq!(1_usize.checked_next_multiple_of(0), None);\nassert_eq!(usize::MAX.checked_next_multiple_of(2), None);
\n1.0.0 (const: 1.32.0) · sourcepub const fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.
\n§Examples
\nBasic usage:
\n\nassert!(16usize.is_power_of_two());\nassert!(!10usize.is_power_of_two());
\n1.0.0 (const: 1.50.0) · sourcepub const fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
.
\nWhen return value overflows (i.e., self > (1 << (N-1))
for type\nuN
), it panics in debug mode and the return value is wrapped to 0 in\nrelease mode (the only situation in which this method can return 0).
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.next_power_of_two(), 2);\nassert_eq!(3usize.next_power_of_two(), 4);\nassert_eq!(0usize.next_power_of_two(), 1);
\n1.0.0 (const: 1.50.0) · sourcepub const fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to self
. If\nthe next power of two is greater than the type’s maximum value,\nNone
is returned, otherwise the power of two is wrapped in Some
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_next_power_of_two(), Some(2));\nassert_eq!(3usize.checked_next_power_of_two(), Some(4));\nassert_eq!(usize::MAX.checked_next_power_of_two(), None);
\nsourcepub const fn wrapping_next_power_of_two(self) -> usize
🔬This is a nightly-only experimental API. (wrapping_next_power_of_two
)
Returns the smallest power of two greater than or equal to n
. If\nthe next power of two is greater than the type’s maximum value,\nthe return value is wrapped to 0
.
\n§Examples
\nBasic usage:
\n\n#![feature(wrapping_next_power_of_two)]\n\nassert_eq!(2usize.wrapping_next_power_of_two(), 2);\nassert_eq!(3usize.wrapping_next_power_of_two(), 4);\nassert_eq!(usize::MAX.wrapping_next_power_of_two(), 0);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_be_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nbig-endian (network) byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_be_bytes();\nassert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_le_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nlittle-endian byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_le_bytes();\nassert_eq!(bytes, [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_ne_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nnative byte order.
\nAs the target platform’s native endianness is used, portable code\nshould use to_be_bytes
or to_le_bytes
, as appropriate,\ninstead.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_ne_bytes();\nassert_eq!(\n bytes,\n if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n } else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n }\n);
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_be_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in big endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_be_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_be_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_le_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in little endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_le_bytes([0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_le_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_le_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_ne_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its memory representation\nas a byte array in native endianness.
\nAs the target platform’s native endianness is used, portable code\nlikely wants to use from_be_bytes
or from_le_bytes
, as\nappropriate instead.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_ne_bytes(if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n} else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n});\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_ne_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_ne_bytes(int_bytes.try_into().unwrap())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn min_value() -> usize
👎Deprecating in a future version: replaced by the MIN
associated constant on this type
New code should prefer to use\nusize::MIN
instead.
\nReturns the smallest value that can be represented by this integer type.
\n1.0.0 (const: 1.32.0) · sourcepub const fn max_value() -> usize
👎Deprecating in a future version: replaced by the MAX
associated constant on this type
New code should prefer to use\nusize::MAX
instead.
\nReturns the largest value that can be represented by this integer type.
\nsourcepub const fn widening_mul(self, rhs: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the complete product self * rhs
without the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nIf you also need to add a carry to the wide result, then you want\nSelf::carrying_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.widening_mul(2), (10, 0));\nassert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));
\nsourcepub const fn carrying_mul(self, rhs: usize, carry: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the “full multiplication” self * rhs + carry
\nwithout the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nPerforms “long multiplication” which takes in an extra amount to add, and may return an\nadditional amount of overflow. This allows for chaining together multiple\nmultiplications to create “big integers” which represent larger values.
\nIf you don’t need the carry
, then you can use Self::widening_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.carrying_mul(2, 0), (10, 0));\nassert_eq!(5u32.carrying_mul(2, 10), (20, 0));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));\nassert_eq!(usize::MAX.carrying_mul(usize::MAX, usize::MAX), (0, usize::MAX));
\nThis is the core operation needed for scalar multiplication when\nimplementing it for wider-than-native types.
\n\n#![feature(bigint_helper_methods)]\nfn scalar_mul_eq(little_endian_digits: &mut Vec<u16>, multiplicand: u16) {\n let mut carry = 0;\n for d in little_endian_digits.iter_mut() {\n (*d, carry) = d.carrying_mul(multiplicand, carry);\n }\n if carry != 0 {\n little_endian_digits.push(carry);\n }\n}\n\nlet mut v = vec![10, 20];\nscalar_mul_eq(&mut v, 3);\nassert_eq!(v, [30, 60]);\n\nassert_eq!(0x87654321_u64 * 0xFEED, 0x86D3D159E38D);\nlet mut v = vec![0x4321, 0x8765];\nscalar_mul_eq(&mut v, 0xFEED);\nassert_eq!(v, [0xE38D, 0xD159, 0x86D3]);
\nIf carry
is zero, this is similar to overflowing_mul
,\nexcept that it gives the value of the overflow instead of just whether one happened:
\n\n#![feature(bigint_helper_methods)]\nlet r = u8::carrying_mul(7, 13, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));\nlet r = u8::carrying_mul(13, 42, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(13, 42));
\nThe value of the first field in the returned tuple matches what you’d get\nby combining the wrapping_mul
and\nwrapping_add
methods:
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(\n 789_u16.carrying_mul(456, 123).0,\n 789_u16.wrapping_mul(456).wrapping_add(123),\n);
\nsourcepub const fn midpoint(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (num_midpoint
)
Calculates the middle point of self
and rhs
.
\nmidpoint(a, b)
is (a + b) >> 1
as if it were performed in a\nsufficiently-large signed integral type. This implies that the result is\nalways rounded towards negative infinity and that no overflow will ever occur.
\n§Examples
\n#![feature(num_midpoint)]\nassert_eq!(0usize.midpoint(4), 2);\nassert_eq!(1usize.midpoint(4), 2);
\n",0,"gosling::context::HandshakeHandle"],["source§impl usize
1.0.0 (const: unstable) · sourcepub fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer.
\nThe string is expected to be an optional +
sign\nfollowed by digits.\nLeading and trailing whitespace represent an error.\nDigits are a subset of these characters, depending on radix
:
\n\n0-9
\na-z
\nA-Z
\n
\n§Panics
\nThis function panics if radix
is not in the range from 2 to 36.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::from_str_radix(\"A\", 16), Ok(10));
\n",0,"gosling::context::HandshakeHandle"],["§impl AtLeast16 for usize
","AtLeast16","gosling::context::HandshakeHandle"],["§impl AtLeast32 for usize
","AtLeast32","gosling::context::HandshakeHandle"],["§impl AtLeast64 for usize
","AtLeast64","gosling::context::HandshakeHandle"],["§impl AtLeast8 for usize
","AtLeast8","gosling::context::HandshakeHandle"],["§impl AtMost128 for usize
","AtMost128","gosling::context::HandshakeHandle"],["§impl AtMost64 for usize
","AtMost64","gosling::context::HandshakeHandle"],["§impl BitOps for usize
","BitOps","gosling::context::HandshakeHandle"],["source§impl ConstParamTy for usize
","ConstParamTy","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Copy for usize
","Copy","gosling::context::HandshakeHandle"],["§impl DefaultIsZeroes for usize
","DefaultIsZeroes","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Eq for usize
","Eq","gosling::context::HandshakeHandle"],["§impl ExtendTarget<usize> for usize
","ExtendTarget","gosling::context::HandshakeHandle"],["source§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["source§impl Integer for usize
","Integer","gosling::context::HandshakeHandle"],["§impl Is64 for usize
","Is64","gosling::context::HandshakeHandle"],["§impl NotAutoValue for usize
","NotAutoValue","gosling::context::HandshakeHandle"],["§impl NumericOps for usize
","NumericOps","gosling::context::HandshakeHandle"],["source§impl SimdCast for usize
","SimdCast","gosling::context::HandshakeHandle"],["source§impl StructuralPartialEq for usize
","StructuralPartialEq","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u16> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u8> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<usize> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["source§impl TrustedStep for usize
","TrustedStep","gosling::context::HandshakeHandle"],["§impl Uint for usize
","Uint","gosling::context::HandshakeHandle"],["source§impl Unsigned for usize
","Unsigned","gosling::context::HandshakeHandle"],["source§impl Weight for usize
","Weight","gosling::context::HandshakeHandle"],["source§impl ZeroablePrimitive for usize
","ZeroablePrimitive","gosling::context::HandshakeHandle"]],
-"tor_interface":[["","Accumulate","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Add<&usize>","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","tor_interface::tor_provider::CircuitToken"],["","AsAny","tor_interface::tor_provider::CircuitToken"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["","Binary","tor_interface::tor_provider::CircuitToken"],["","BitAnd<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitAnd","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","tor_interface::tor_provider::CircuitToken"],["","BitOr<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitOr","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","tor_interface::tor_provider::CircuitToken"],["","BitRegister","tor_interface::tor_provider::CircuitToken"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","tor_interface::tor_provider::CircuitToken"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","tor_interface::tor_provider::CircuitToken"],["","BitXor<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitXor","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","tor_interface::tor_provider::CircuitToken"],["","Bits","tor_interface::tor_provider::CircuitToken"],["","Bounded","tor_interface::tor_provider::CircuitToken"],["","CastSigned","tor_interface::tor_provider::CircuitToken"],["","CastUnsigned","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedAdd for usize
","CheckedAdd","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedDiv for usize
","CheckedDiv","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedMul for usize
","CheckedMul","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedNeg for usize
","CheckedNeg","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedRem for usize
","CheckedRem","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShl for usize
","CheckedShl","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShr for usize
","CheckedShr","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedSub for usize
","CheckedSub","tor_interface::tor_provider::CircuitToken"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","tor_interface::tor_provider::CircuitToken"],["","Clone","tor_interface::tor_provider::CircuitToken"],["","ConstOne","tor_interface::tor_provider::CircuitToken"],["","ConstZero","tor_interface::tor_provider::CircuitToken"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","tor_interface::tor_provider::CircuitToken"],["","Debug","tor_interface::tor_provider::CircuitToken"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","tor_interface::tor_provider::CircuitToken"],["","Default","tor_interface::tor_provider::CircuitToken"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","tor_interface::tor_provider::CircuitToken"],["","Display","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Div<&usize>","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","tor_interface::tor_provider::CircuitToken"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","tor_interface::tor_provider::CircuitToken"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","tor_interface::tor_provider::CircuitToken"],["","FmtConst","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","tor_interface::tor_provider::CircuitToken"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","tor_interface::tor_provider::CircuitToken"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","tor_interface::tor_provider::CircuitToken"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","tor_interface::tor_provider::CircuitToken"],["","FromStr","tor_interface::tor_provider::CircuitToken"],["","FromZeroes","tor_interface::tor_provider::CircuitToken"],["","Fundamental","tor_interface::tor_provider::CircuitToken"],["","Hash","tor_interface::tor_provider::CircuitToken"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","tor_interface::tor_provider::CircuitToken"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","tor_interface::tor_provider::CircuitToken"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","tor_interface::tor_provider::CircuitToken"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","tor_interface::tor_provider::CircuitToken"],["","LowerExp","tor_interface::tor_provider::CircuitToken"],["","LowerHex","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Mul<&usize>","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","MulAdd","tor_interface::tor_provider::CircuitToken"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","tor_interface::tor_provider::CircuitToken"],["","Not","tor_interface::tor_provider::CircuitToken"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","tor_interface::tor_provider::CircuitToken"],["","NumCast","tor_interface::tor_provider::CircuitToken"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","tor_interface::tor_provider::CircuitToken"],["","Octal","tor_interface::tor_provider::CircuitToken"],["","One","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Ord for usize
","Ord","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingAdd for usize
","OverflowingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingMul for usize
","OverflowingMul","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingSub for usize
","OverflowingSub","tor_interface::tor_provider::CircuitToken"],["","ParseHex","tor_interface::tor_provider::CircuitToken"],["source§impl PartialEq<Value> for usize
","PartialEq","tor_interface::tor_provider::CircuitToken"],["","PartialEq","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","tor_interface::tor_provider::CircuitToken"],["","PhfBorrow","tor_interface::tor_provider::CircuitToken"],["","PhfHash","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u16>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u32>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u8>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","tor_interface::tor_provider::CircuitToken"],["","Product<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Product","tor_interface::tor_provider::CircuitToken"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Rem<&usize>","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","tor_interface::tor_provider::CircuitToken"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["source§impl Roots for usize
","Roots","tor_interface::tor_provider::CircuitToken"],["","RowIndex","tor_interface::tor_provider::CircuitToken"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","tor_interface::tor_provider::CircuitToken"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","tor_interface::tor_provider::CircuitToken"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","tor_interface::tor_provider::CircuitToken"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","tor_interface::tor_provider::CircuitToken"],["","Shl<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["","Shr<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["
fn min(self, other: Self) -> Selfwhere
diff --git a/crates/tor_interface/tor_provider/enum.OnionAddr.html b/crates/tor_interface/tor_provider/enum.OnionAddr.html
index 330e8dc7..212631b0 100644
--- a/crates/tor_interface/tor_provider/enum.OnionAddr.html
+++ b/crates/tor_interface/tor_provider/enum.OnionAddr.html
@@ -1,7 +1,7 @@
OnionAddr in tor_interface::tor_provider - Rust Enum tor_interface::tor_provider::OnionAddr
source · pub enum OnionAddr {
V3(OnionAddrV3),
}
Expand description
An onion service address analog to std::net::SocketAddr
-Variants§
§V3(OnionAddrV3)
Trait Implementations§
source§impl Hash for OnionAddr
1.3.0 · source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+
Variants§
§V3(OnionAddrV3)
Trait Implementations§
source§impl Ord for OnionAddr
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/tor_interface/tor_provider/struct.DomainAddr.html b/crates/tor_interface/tor_provider/struct.DomainAddr.html
index 9093e21e..c541ef98 100644
--- a/crates/tor_interface/tor_provider/struct.DomainAddr.html
+++ b/crates/tor_interface/tor_provider/struct.DomainAddr.html
@@ -3,7 +3,7 @@
Implementations§
Trait Implementations§
source§impl Clone for DomainAddr
source§fn clone(&self) -> DomainAddr
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for DomainAddr
source§impl Display for DomainAddr
source§impl FromStr for DomainAddr
Trait Implementations§
source§impl Clone for DomainAddr
source§fn clone(&self) -> DomainAddr
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for DomainAddr
source§impl Display for DomainAddr
source§impl FromStr for DomainAddr
source§impl Hash for DomainAddr
source§impl Ord for DomainAddr
source§fn cmp(&self, other: &DomainAddr) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/type.impl/std/primitive.usize.js b/crates/type.impl/std/primitive.usize.js
index da014e4e..ef01c053 100644
--- a/crates/type.impl/std/primitive.usize.js
+++ b/crates/type.impl/std/primitive.usize.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
-"gosling":[["","Accumulate","gosling::context::HandshakeHandle"],["","Add<&'a BigInt>","gosling::context::HandshakeHandle"],["","Add<&'a BigUint>","gosling::context::HandshakeHandle"],["","Add<&usize>","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","gosling::context::HandshakeHandle"],["","AsAny","gosling::context::HandshakeHandle"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["","Binary","gosling::context::HandshakeHandle"],["","BitAnd<&usize>","gosling::context::HandshakeHandle"],["","BitAnd","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","gosling::context::HandshakeHandle"],["","BitOr<&usize>","gosling::context::HandshakeHandle"],["","BitOr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","gosling::context::HandshakeHandle"],["","BitRegister","gosling::context::HandshakeHandle"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","gosling::context::HandshakeHandle"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","gosling::context::HandshakeHandle"],["","BitXor<&usize>","gosling::context::HandshakeHandle"],["","BitXor","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","gosling::context::HandshakeHandle"],["","Bits","gosling::context::HandshakeHandle"],["","Bounded","gosling::context::HandshakeHandle"],["","CastSigned","gosling::context::HandshakeHandle"],["","CastUnsigned","gosling::context::HandshakeHandle"],["source§impl CheckedAdd for usize
","CheckedAdd","gosling::context::HandshakeHandle"],["source§impl CheckedDiv for usize
","CheckedDiv","gosling::context::HandshakeHandle"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","gosling::context::HandshakeHandle"],["source§impl CheckedMul for usize
","CheckedMul","gosling::context::HandshakeHandle"],["source§impl CheckedNeg for usize
","CheckedNeg","gosling::context::HandshakeHandle"],["source§impl CheckedRem for usize
","CheckedRem","gosling::context::HandshakeHandle"],["source§impl CheckedShl for usize
","CheckedShl","gosling::context::HandshakeHandle"],["source§impl CheckedShr for usize
","CheckedShr","gosling::context::HandshakeHandle"],["source§impl CheckedSub for usize
","CheckedSub","gosling::context::HandshakeHandle"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","gosling::context::HandshakeHandle"],["","Clone","gosling::context::HandshakeHandle"],["","ConstOne","gosling::context::HandshakeHandle"],["","ConstZero","gosling::context::HandshakeHandle"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","gosling::context::HandshakeHandle"],["","Debug","gosling::context::HandshakeHandle"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","gosling::context::HandshakeHandle"],["","Default","gosling::context::HandshakeHandle"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","gosling::context::HandshakeHandle"],["","Display","gosling::context::HandshakeHandle"],["","Div<&'a BigInt>","gosling::context::HandshakeHandle"],["","Div<&'a BigUint>","gosling::context::HandshakeHandle"],["","Div<&usize>","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","gosling::context::HandshakeHandle"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","gosling::context::HandshakeHandle"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","gosling::context::HandshakeHandle"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","gosling::context::HandshakeHandle"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","gosling::context::HandshakeHandle"],["","FmtConst","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","gosling::context::HandshakeHandle"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","gosling::context::HandshakeHandle"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","gosling::context::HandshakeHandle"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","gosling::context::HandshakeHandle"],["","FromStr","gosling::context::HandshakeHandle"],["","FromZeroes","gosling::context::HandshakeHandle"],["","Fundamental","gosling::context::HandshakeHandle"],["","Hash","gosling::context::HandshakeHandle"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","gosling::context::HandshakeHandle"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","gosling::context::HandshakeHandle"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","gosling::context::HandshakeHandle"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","gosling::context::HandshakeHandle"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","gosling::context::HandshakeHandle"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","gosling::context::HandshakeHandle"],["","LowerExp","gosling::context::HandshakeHandle"],["","LowerHex","gosling::context::HandshakeHandle"],["","Mul<&'a BigInt>","gosling::context::HandshakeHandle"],["","Mul<&'a BigUint>","gosling::context::HandshakeHandle"],["","Mul<&usize>","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","MulAdd","gosling::context::HandshakeHandle"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","gosling::context::HandshakeHandle"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","gosling::context::HandshakeHandle"],["","Not","gosling::context::HandshakeHandle"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","gosling::context::HandshakeHandle"],["","NumCast","gosling::context::HandshakeHandle"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","gosling::context::HandshakeHandle"],["","Octal","gosling::context::HandshakeHandle"],["","One","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Ord for usize
","Ord","gosling::context::HandshakeHandle"],["source§impl OverflowingAdd for usize
","OverflowingAdd","gosling::context::HandshakeHandle"],["source§impl OverflowingMul for usize
","OverflowingMul","gosling::context::HandshakeHandle"],["source§impl OverflowingSub for usize
","OverflowingSub","gosling::context::HandshakeHandle"],["","ParseHex","gosling::context::HandshakeHandle"],["source§impl PartialEq<Value> for usize
","PartialEq","gosling::context::HandshakeHandle"],["","PartialEq","gosling::context::HandshakeHandle"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","gosling::context::HandshakeHandle"],["","PhfBorrow","gosling::context::HandshakeHandle"],["","PhfHash","gosling::context::HandshakeHandle"],["","Pow<&'a u16>","gosling::context::HandshakeHandle"],["","Pow<&'a u32>","gosling::context::HandshakeHandle"],["","Pow<&'a u8>","gosling::context::HandshakeHandle"],["","Pow<&'a usize>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","gosling::context::HandshakeHandle"],["","Product<&'a usize>","gosling::context::HandshakeHandle"],["","Product","gosling::context::HandshakeHandle"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","gosling::context::HandshakeHandle"],["","Rem<&'a BigInt>","gosling::context::HandshakeHandle"],["","Rem<&'a BigUint>","gosling::context::HandshakeHandle"],["","Rem<&usize>","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","gosling::context::HandshakeHandle"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","gosling::context::HandshakeHandle"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["source§impl Roots for usize
","Roots","gosling::context::HandshakeHandle"],["","RowIndex","gosling::context::HandshakeHandle"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","gosling::context::HandshakeHandle"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","gosling::context::HandshakeHandle"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","gosling::context::HandshakeHandle"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","gosling::context::HandshakeHandle"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","gosling::context::HandshakeHandle"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","gosling::context::HandshakeHandle"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","gosling::context::HandshakeHandle"],["","Shl<&i128>","gosling::context::HandshakeHandle"],["","Shl<&i16>","gosling::context::HandshakeHandle"],["","Shl<&i32>","gosling::context::HandshakeHandle"],["","Shl<&i64>","gosling::context::HandshakeHandle"],["","Shl<&i8>","gosling::context::HandshakeHandle"],["","Shl<&isize>","gosling::context::HandshakeHandle"],["","Shl<&u128>","gosling::context::HandshakeHandle"],["","Shl<&u16>","gosling::context::HandshakeHandle"],["","Shl<&u32>","gosling::context::HandshakeHandle"],["","Shl<&u64>","gosling::context::HandshakeHandle"],["","Shl<&u8>","gosling::context::HandshakeHandle"],["","Shl<&usize>","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["","Shr<&i128>","gosling::context::HandshakeHandle"],["","Shr<&i16>","gosling::context::HandshakeHandle"],["","Shr<&i32>","gosling::context::HandshakeHandle"],["","Shr<&i64>","gosling::context::HandshakeHandle"],["","Shr<&i8>","gosling::context::HandshakeHandle"],["","Shr<&isize>","gosling::context::HandshakeHandle"],["","Shr<&u128>","gosling::context::HandshakeHandle"],["","Shr<&u16>","gosling::context::HandshakeHandle"],["","Shr<&u32>","gosling::context::HandshakeHandle"],["","Shr<&u64>","gosling::context::HandshakeHandle"],["","Shr<&u8>","gosling::context::HandshakeHandle"],["","Shr<&usize>","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i128> for usize
source§fn shr_assign(&mut self, other: &i128)
Performs the >>=
operation. Read more","ShrAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i16> for usize
source§fn shr_assign(&mut self, other: &i16)
Performs the >>=
operation. Read more","ShrAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i32> for usize
source§fn shr_assign(&mut self, other: &i32)
Performs the >>=
operation. Read more","ShrAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i64> for usize
source§fn shr_assign(&mut self, other: &i64)
Performs the >>=
operation. Read more","ShrAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i8> for usize
source§fn shr_assign(&mut self, other: &i8)
Performs the >>=
operation. Read more","ShrAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&isize> for usize
source§fn shr_assign(&mut self, other: &isize)
Performs the >>=
operation. Read more","ShrAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u128> for usize
source§fn shr_assign(&mut self, other: &u128)
Performs the >>=
operation. Read more","ShrAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u16> for usize
source§fn shr_assign(&mut self, other: &u16)
Performs the >>=
operation. Read more","ShrAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u32> for usize
source§fn shr_assign(&mut self, other: &u32)
Performs the >>=
operation. Read more","ShrAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u64> for usize
source§fn shr_assign(&mut self, other: &u64)
Performs the >>=
operation. Read more","ShrAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u8> for usize
source§fn shr_assign(&mut self, other: &u8)
Performs the >>=
operation. Read more","ShrAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&usize> for usize
source§fn shr_assign(&mut self, other: &usize)
Performs the >>=
operation. Read more","ShrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i128> for usize
source§fn shr_assign(&mut self, other: i128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i16> for usize
source§fn shr_assign(&mut self, other: i16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i32> for usize
source§fn shr_assign(&mut self, other: i32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i64> for usize
source§fn shr_assign(&mut self, other: i64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i8> for usize
source§fn shr_assign(&mut self, other: i8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<isize> for usize
source§fn shr_assign(&mut self, other: isize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u128> for usize
source§fn shr_assign(&mut self, other: u128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u16> for usize
source§fn shr_assign(&mut self, other: u16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u32> for usize
source§fn shr_assign(&mut self, other: u32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u64> for usize
source§fn shr_assign(&mut self, other: u64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u8> for usize
source§fn shr_assign(&mut self, other: u8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign for usize
source§fn shr_assign(&mut self, other: usize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["source§impl SimdElement for usize
","SimdElement","gosling::context::HandshakeHandle"],["1.15.0 (const: unstable) · source§impl<T> SliceIndex<[T]> for usize
The methods index
and index_mut
panic if the index is out of bounds.
\nsource§fn get(self, slice: &[T]) -> Option<&T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a shared reference to the output at this location, if in\nbounds.source§fn get_mut(self, slice: &mut [T]) -> Option<&mut T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable reference to the output at this location, if in\nbounds.source§unsafe fn get_unchecked(self, slice: *const [T]) -> *const T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.source§unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.","SliceIndex<[T]>","gosling::context::HandshakeHandle"],["§impl SmartDisplay for usize
§fn metadata(&self, f: FormatterOptions) -> Metadata<'_, usize>
Compute any information needed to format the value. This must, at a minimum, determine the\nwidth of the value before any padding is added by the formatter. Read more§fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Format the value using the given formatter. This is the same as Display::fmt
. Read more§fn fmt_with_metadata(\n &self,\n f: &mut Formatter<'_>,\n _metadata: Metadata<'_, Self>,\n) -> Result<(), Error>
Format the value using the given formatter and metadata. The formatted output should have\nthe width indicated by the metadata. This is before any padding is added by the\nformatter. Read more","SmartDisplay","gosling::context::HandshakeHandle"],["source§impl Step for usize
source§fn forward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn backward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn forward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn backward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn steps_between(start: &usize, end: &usize) -> Option<usize>
🔬This is a nightly-only experimental API. (step_trait
)","Step","gosling::context::HandshakeHandle"],["","Sub<&'a BigInt>","gosling::context::HandshakeHandle"],["","Sub<&'a BigUint>","gosling::context::HandshakeHandle"],["","Sub<&usize>","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["1.22.0 · source§impl SubAssign<&usize> for usize
source§fn sub_assign(&mut self, other: &usize)
Performs the -=
operation. Read more","SubAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl SubAssign for usize
source§fn sub_assign(&mut self, other: usize)
Performs the -=
operation. Read more","SubAssign","gosling::context::HandshakeHandle"],["","Sum<&'a usize>","gosling::context::HandshakeHandle"],["","Sum","gosling::context::HandshakeHandle"],["","ToBigInt","gosling::context::HandshakeHandle"],["source§impl ToBigUint for usize
source§fn to_biguint(&self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","ToBigUint","gosling::context::HandshakeHandle"],["source§impl ToBytes for usize
§type Bytes = [u8; 8]
source§fn to_be_bytes(&self) -> <usize as ToBytes>::Bytes
Return the memory representation of this number as a byte array in big-endian byte order. Read more","ToBytes","gosling::context::HandshakeHandle"],["source§impl ToPrimitive for usize
source§fn to_isize(&self) -> Option<isize>
Converts the value of self
to an isize
. If the value cannot be\nrepresented by an isize
, then None
is returned.source§fn to_i8(&self) -> Option<i8>
Converts the value of self
to an i8
. If the value cannot be\nrepresented by an i8
, then None
is returned.source§fn to_i16(&self) -> Option<i16>
Converts the value of self
to an i16
. If the value cannot be\nrepresented by an i16
, then None
is returned.source§fn to_i32(&self) -> Option<i32>
Converts the value of self
to an i32
. If the value cannot be\nrepresented by an i32
, then None
is returned.source§fn to_i64(&self) -> Option<i64>
Converts the value of self
to an i64
. If the value cannot be\nrepresented by an i64
, then None
is returned.source§fn to_i128(&self) -> Option<i128>
Converts the value of self
to an i128
. If the value cannot be\nrepresented by an i128
(i64
under the default implementation), then\nNone
is returned. Read moresource§fn to_usize(&self) -> Option<usize>
Converts the value of self
to a usize
. If the value cannot be\nrepresented by a usize
, then None
is returned.source§fn to_u8(&self) -> Option<u8>
Converts the value of self
to a u8
. If the value cannot be\nrepresented by a u8
, then None
is returned.source§fn to_u16(&self) -> Option<u16>
Converts the value of self
to a u16
. If the value cannot be\nrepresented by a u16
, then None
is returned.source§fn to_u32(&self) -> Option<u32>
Converts the value of self
to a u32
. If the value cannot be\nrepresented by a u32
, then None
is returned.source§fn to_u64(&self) -> Option<u64>
Converts the value of self
to a u64
. If the value cannot be\nrepresented by a u64
, then None
is returned.source§fn to_u128(&self) -> Option<u128>
Converts the value of self
to a u128
. If the value cannot be\nrepresented by a u128
(u64
under the default implementation), then\nNone
is returned. Read more","ToPrimitive","gosling::context::HandshakeHandle"],["","ToSql","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","TryFrom>","gosling::context::HandshakeHandle"],["","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i128> for usize
source§fn try_from(u: i128) -> Result<usize, <usize as TryFrom<i128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i16> for usize
source§fn try_from(u: i16) -> Result<usize, <usize as TryFrom<i16>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i32> for usize
source§fn try_from(u: i32) -> Result<usize, <usize as TryFrom<i32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i64> for usize
source§fn try_from(u: i64) -> Result<usize, <usize as TryFrom<i64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i8> for usize
source§fn try_from(u: i8) -> Result<usize, <usize as TryFrom<i8>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<isize> for usize
source§fn try_from(u: isize) -> Result<usize, <usize as TryFrom<isize>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u128> for usize
source§fn try_from(u: u128) -> Result<usize, <usize as TryFrom<u128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u32> for usize
source§fn try_from(value: u32) -> Result<usize, <usize as TryFrom<u32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u64> for usize
source§fn try_from(value: u64) -> Result<usize, <usize as TryFrom<u64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["§impl Unsigned for usize
§fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.§fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
. Read more§fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to n
. If the\nnext power of two is greater than the type’s maximum value, None
is\nreturned, otherwise the power of two is wrapped in Some
.","Unsigned","gosling::context::HandshakeHandle"],["","UpperExp","gosling::context::HandshakeHandle"],["","UpperHex","gosling::context::HandshakeHandle"],["","Value","gosling::context::HandshakeHandle"],["source§impl WrappingAdd for usize
source§fn wrapping_add(&self, v: &usize) -> usize
Wrapping (modular) addition. Computes self + other
, wrapping around at the boundary of\nthe type.","WrappingAdd","gosling::context::HandshakeHandle"],["source§impl WrappingMul for usize
source§fn wrapping_mul(&self, v: &usize) -> usize
Wrapping (modular) multiplication. Computes self * other
, wrapping around at the boundary\nof the type.","WrappingMul","gosling::context::HandshakeHandle"],["source§impl WrappingNeg for usize
source§fn wrapping_neg(&self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type. Read more","WrappingNeg","gosling::context::HandshakeHandle"],["source§impl WrappingShl for usize
","WrappingShl","gosling::context::HandshakeHandle"],["source§impl WrappingShr for usize
","WrappingShr","gosling::context::HandshakeHandle"],["source§impl WrappingSub for usize
source§fn wrapping_sub(&self, v: &usize) -> usize
Wrapping (modular) subtraction. Computes self - other
, wrapping around at the boundary\nof the type.","WrappingSub","gosling::context::HandshakeHandle"],["","WriteHex","gosling::context::HandshakeHandle"],["§impl Writeable for usize
§fn write_to<W>(&self, sink: &mut W) -> Result<(), Error>
Writes a string to the given sink. Errors from the sink are bubbled up.\nThe default implementation delegates to write_to_parts
, and discards any\nPart
annotations.§fn writeable_length_hint(&self) -> LengthHint
Returns a hint for the number of UTF-8 bytes that will be written to the sink. Read more§fn write_to_parts<S>(&self, sink: &mut S) -> Result<(), Error>where\n S: PartsWrite + ?Sized,
Write bytes and Part
annotations to the given sink. Errors from the\nsink are bubbled up. The default implementation delegates to write_to
,\nand doesn’t produce any Part
annotations.§fn write_to_string(&self) -> Cow<'_, str>
Creates a new String
with the data from this Writeable
. Like ToString
,\nbut smaller and faster. Read more§fn writeable_cmp_bytes(&self, other: &[u8]) -> Ordering
Compares the contents of this Writeable
to the given bytes\nwithout allocating a String to hold the Writeable
contents. Read more","Writeable","gosling::context::HandshakeHandle"],["§impl<'a> Yokeable<'a> for usize
§fn transform_owned(self) -> <usize as Yokeable<'a>>::Output
§unsafe fn make(this: <usize as Yokeable<'a>>::Output) -> usize
This method can be used to cast away Self<'a>
’s lifetime. Read more§fn transform_mut<F>(&'a mut self, f: F)
This method must cast self
between &'a mut Self<'static>
and &'a mut Self<'a>
,\nand pass it to f
. Read more","Yokeable<'a>","gosling::context::HandshakeHandle"],["","Zero","gosling::context::HandshakeHandle"],["","ZeroFrom<'a, usize>","gosling::context::HandshakeHandle"],["§impl<'a> ZeroMapKV<'a> for usize
","ZeroMapKV<'a>","gosling::context::HandshakeHandle"],["source§impl usize
1.43.0 · sourcepub const MIN: usize = 0usize
The smallest value that can be represented by this integer type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MIN, 0);
\n1.43.0 · sourcepub const MAX: usize = 18_446_744_073_709_551_615usize
The largest value that can be represented by this integer type\n(264 − 1 on 64-bit targets).
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX, 18446744073709551615);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b01001100usize;\n\nassert_eq!(n.count_ones(), 3);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX.count_zeros(), 0);
\n1.0.0 (const: 1.32.0) · sourcepub const fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of self
.
\nDepending on what you’re doing with the value, you might also be interested in the\nilog2
function which returns a consistent number, even if the type widens.
\n§Examples
\nBasic usage:
\n\nlet n = usize::MAX >> 2;\n\nassert_eq!(n.leading_zeros(), 2);
\n1.0.0 (const: 1.32.0) · sourcepub const fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b0101000usize;\n\nassert_eq!(n.trailing_zeros(), 3);
\n1.46.0 (const: 1.46.0) · sourcepub const fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = !(usize::MAX >> 2);\n\nassert_eq!(n.leading_ones(), 2);
\n1.46.0 (const: 1.46.0) · sourcepub const fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b1010111usize;\n\nassert_eq!(n.trailing_ones(), 3);
\nsourcepub const fn cast_signed(self) -> isize
🔬This is a nightly-only experimental API. (integer_sign_cast
)
Returns the bit pattern of self
reinterpreted as a signed integer of the same size.
\nThis produces the same result as an as
cast, but ensures that the bit-width remains\nthe same.
\n§Examples
\nBasic usage:
\n\n#![feature(integer_sign_cast)]\n\nlet n = usize::MAX;\n\nassert_eq!(n.cast_signed(), -1isize);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
,\nwrapping the truncated bits to the end of the resulting integer.
\nPlease note this isn’t the same operation as the <<
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0xaa00000000006e1usize;\nlet m = 0x6e10aa;\n\nassert_eq!(n.rotate_left(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
,\nwrapping the truncated bits to the beginning of the resulting\ninteger.
\nPlease note this isn’t the same operation as the >>
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0x6e10aausize;\nlet m = 0xaa00000000006e1;\n\nassert_eq!(n.rotate_right(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn swap_bytes(self) -> usize
Reverses the byte order of the integer.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.swap_bytes();\n\nassert_eq!(m, 0x5634129078563412);
\n1.37.0 (const: 1.37.0) · sourcepub const fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit,\nsecond least-significant bit becomes second most-significant bit, etc.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.reverse_bits();\n\nassert_eq!(m, 0x6a2c48091e6a2c48);\nassert_eq!(0, 0usize.reverse_bits());
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_be(x: usize) -> usize
Converts an integer from big endian to the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(usize::from_be(n), n)\n} else {\n assert_eq!(usize::from_be(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_le(x: usize) -> usize
Converts an integer from little endian to the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(usize::from_le(n), n)\n} else {\n assert_eq!(usize::from_le(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_be(self) -> usize
Converts self
to big endian from the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(n.to_be(), n)\n} else {\n assert_eq!(n.to_be(), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_le(self) -> usize
Converts self
to little endian from the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(n.to_le(), n)\n} else {\n assert_eq!(n.to_le(), n.swap_bytes())\n}
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
\nif overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!((usize::MAX - 2).checked_add(1), Some(usize::MAX - 1));\nassert_eq!((usize::MAX - 2).checked_add(3), None);
\nsourcepub const fn strict_add(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer addition. Computes self + rhs
, panicking\nif overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!((usize::MAX - 2).strict_add(1), usize::MAX - 1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add(3);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_add(self, rhs: usize) -> usize
Unchecked integer addition. Computes self + rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_add(y)
is semantically equivalent to calling\nx.
checked_add
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_add
.
\n§Safety
\nThis results in undefined behavior when\nself + rhs > usize::MAX
or self + rhs < usize::MIN
,\ni.e. when checked_add
would return None
.
\n1.66.0 (const: 1.66.0) · sourcepub const fn checked_add_signed(self, rhs: isize) -> Option<usize>
Checked addition with a signed integer. Computes self + rhs
,\nreturning None
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_add_signed(2), Some(3));\nassert_eq!(1usize.checked_add_signed(-2), None);\nassert_eq!((usize::MAX - 2).checked_add_signed(3), None);
\nsourcepub const fn strict_add_signed(self, rhs: isize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict addition with a signed integer. Computes self + rhs
,\npanicking if overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_add_signed(2), 3);
\nThe following panic because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_add_signed(-2);
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add_signed(3);
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_sub(1), Some(0));\nassert_eq!(0usize.checked_sub(1), None);
\nsourcepub const fn strict_sub(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer subtraction. Computes self - rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_sub(1), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0usize.strict_sub(1);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_sub(self, rhs: usize) -> usize
Unchecked integer subtraction. Computes self - rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_sub(y)
is semantically equivalent to calling\nx.
checked_sub
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_sub
.
\nIf you find yourself writing code like this:
\n\nif foo >= bar {\n // SAFETY: just checked it will not overflow\n let diff = unsafe { foo.unchecked_sub(bar) };\n // ... use diff ...\n}
\nConsider changing it to
\n\nif let Some(diff) = foo.checked_sub(bar) {\n // ... use diff ...\n}
\nAs that does exactly the same thing – including telling the optimizer\nthat the subtraction cannot overflow – but avoids needing unsafe
.
\n§Safety
\nThis results in undefined behavior when\nself - rhs > usize::MAX
or self - rhs < usize::MIN
,\ni.e. when checked_sub
would return None
.
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_mul(1), Some(5));\nassert_eq!(usize::MAX.checked_mul(2), None);
\nsourcepub const fn strict_mul(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer multiplication. Computes self * rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(5usize.strict_mul(1), 5);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_mul(2);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_mul(self, rhs: usize) -> usize
Unchecked integer multiplication. Computes self * rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_mul(y)
is semantically equivalent to calling\nx.
checked_mul
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_mul
.
\n§Safety
\nThis results in undefined behavior when\nself * rhs > usize::MAX
or self * rhs < usize::MIN
,\ni.e. when checked_mul
would return None
.
\n1.0.0 (const: 1.52.0) · sourcepub const fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div(2), Some(64));\nassert_eq!(1usize.checked_div(0), None);
\nsourcepub const fn strict_div(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer division. Computes self / rhs
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div_euclid(2), Some(64));\nassert_eq!(1usize.checked_div_euclid(0), None);
\nsourcepub const fn strict_div_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean division. Computes self.div_euclid(rhs)
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div_euclid(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div_euclid(0);
\n1.7.0 (const: 1.52.0) · sourcepub const fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem(2), Some(1));\nassert_eq!(5usize.checked_rem(0), None);
\nsourcepub const fn strict_rem(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer remainder. Computes self % rhs
.\nStrict remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean modulo. Computes self.rem_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem_euclid(2), Some(1));\nassert_eq!(5usize.checked_rem_euclid(0), None);
\nsourcepub const fn strict_rem_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean modulo. Computes self.rem_euclid(rhs)
.\nStrict modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem_euclid(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem_euclid(0);
\n1.67.0 (const: 1.67.0) · sourcepub const fn ilog(self, base: usize) -> u32
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nThis method might not be optimized owing to implementation details;\nilog2
can produce results more efficiently for base 2, and ilog10
\ncan produce results more efficiently for base 10.
\n§Panics
\nThis function will panic if self
is zero, or if base
is less than 2.
\n§Examples
\nassert_eq!(5usize.ilog(5), 1);
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog(self, base: usize) -> Option<u32>
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nReturns None
if the number is zero, or if the base is not at least 2.
\nThis method might not be optimized owing to implementation details;\nchecked_ilog2
can produce results more efficiently for base 2, and\nchecked_ilog10
can produce results more efficiently for base 10.
\n§Examples
\nassert_eq!(5usize.checked_ilog(5), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog2(self) -> Option<u32>
Returns the base 2 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(2usize.checked_ilog2(), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog10(self) -> Option<u32>
Returns the base 10 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(10usize.checked_ilog10(), Some(1));
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_neg(self) -> Option<usize>
Checked negation. Computes -self
, returning None
unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0usize.checked_neg(), Some(0));\nassert_eq!(1usize.checked_neg(), None);
\nsourcepub const fn strict_neg(self) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict negation. Computes -self
, panicking unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0usize.strict_neg(), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_neg();
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x1usize.checked_shl(4), Some(0x10));\nassert_eq!(0x10usize.checked_shl(129), None);
\nsourcepub const fn strict_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift left. Computes self << rhs
, panicking if rhs
is larger\nthan or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x1usize.strict_shl(4), 0x10);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shl(129);
\nsourcepub const unsafe fn unchecked_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift left. Computes self << rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shl
would return None
.
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x10usize.checked_shr(4), Some(0x1));\nassert_eq!(0x10usize.checked_shr(129), None);
\nsourcepub const fn strict_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift right. Computes self >> rhs
, panicking rhs
is\nlarger than or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x10usize.strict_shr(4), 0x1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shr(129);
\nsourcepub const unsafe fn unchecked_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift right. Computes self >> rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shr
would return None
.
\n1.34.0 (const: 1.50.0) · sourcepub const fn checked_pow(self, exp: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_pow(5), Some(32));\nassert_eq!(usize::MAX.checked_pow(2), None);
\nsourcepub const fn strict_pow(self, exp: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict exponentiation. Computes self.pow(exp)
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(2usize.strict_pow(5), 32);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_pow(2);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at\nthe numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_add(1), 101);\nassert_eq!(usize::MAX.saturating_add(127), usize::MAX);
\n1.66.0 (const: 1.66.0) · sourcepub const fn saturating_add_signed(self, rhs: isize) -> usize
Saturating addition with a signed integer. Computes self + rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.saturating_add_signed(2), 3);\nassert_eq!(1usize.saturating_add_signed(-2), 0);\nassert_eq!((usize::MAX - 2).saturating_add_signed(4), usize::MAX);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating\nat the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_sub(27), 73);\nassert_eq!(13usize.saturating_sub(127), 0);
\n1.7.0 (const: 1.47.0) · sourcepub const fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.saturating_mul(10), 20);\nassert_eq!((usize::MAX).saturating_mul(10), usize::MAX);
\n1.58.0 (const: 1.58.0) · sourcepub const fn saturating_div(self, rhs: usize) -> usize
1.34.0 (const: 1.50.0) · sourcepub const fn saturating_pow(self, exp: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(4usize.saturating_pow(3), 64);\nassert_eq!(usize::MAX.saturating_pow(2), usize::MAX);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(200usize.wrapping_add(55), 255);\nassert_eq!(200usize.wrapping_add(usize::MAX), 199);
\n1.66.0 (const: 1.66.0) · sourcepub const fn wrapping_add_signed(self, rhs: isize) -> usize
Wrapping (modular) addition with a signed integer. Computes\nself + rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_add_signed(2), 3);\nassert_eq!(1usize.wrapping_add_signed(-2), usize::MAX);\nassert_eq!((usize::MAX - 2).wrapping_add_signed(4), 1);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_sub(100), 0);\nassert_eq!(100usize.wrapping_sub(usize::MAX), 101);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u8
is used here.
\n\nassert_eq!(10u8.wrapping_mul(12), 120);\nassert_eq!(25u8.wrapping_mul(12), 44);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div(10), 10);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div_euclid(10), 10);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
.\nWrapped remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem(10), 0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean modulo. Computes self.rem_euclid(rhs)
.\nWrapped modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem_euclid(10), 0);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type.
\nSince unsigned types do not have negative equivalents\nall applications of this function will wrap (except for -0
).\nFor values smaller than the corresponding signed type’s maximum\nthe result is the same as casting the corresponding signed value.\nAny larger values are equivalent to MAX + 1 - (val - MAX - 1)
where\nMAX
is the corresponding signed type’s maximum.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0_usize.wrapping_neg(), 0);\nassert_eq!(usize::MAX.wrapping_neg(), 1);\nassert_eq!(13_usize.wrapping_neg(), (!13) + 1);\nassert_eq!(42_usize.wrapping_neg(), !(42 - 1));
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-left; the\nRHS of a wrapping shift-left is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_left
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_shl(7), 128);\nassert_eq!(1usize.wrapping_shl(128), 1);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-right; the\nRHS of a wrapping shift-right is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_right
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.wrapping_shr(7), 1);\nassert_eq!(128usize.wrapping_shr(128), 128);
\n1.34.0 (const: 1.50.0) · sourcepub const fn wrapping_pow(self, exp: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.wrapping_pow(5), 243);\nassert_eq!(3u8.wrapping_pow(6), 217);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_add(self, rhs: usize) -> (usize, bool)
Calculates self
+ rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_add(2), (7, false));\nassert_eq!(usize::MAX.overflowing_add(1), (0, true));
\nsourcepub const fn carrying_add(self, rhs: usize, carry: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
+ rhs
+ carry
and returns a tuple containing\nthe sum and the output carry.
\nPerforms “ternary addition” of two integer operands and a carry-in\nbit, and returns an output integer and a carry-out bit. This allows\nchaining together multiple additions to create a wider addition, and\ncan be useful for bignum addition.
\nThis can be thought of as a 64-bit “full adder”, in the electronics sense.
\nIf the input carry is false, this method is equivalent to\noverflowing_add
, and the output carry is\nequal to the overflow flag. Note that although carry and overflow\nflags are similar for unsigned integers, they are different for\nsigned integers.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 3 MAX (a = 3 × 2^64 + 2^64 - 1)\n// + 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 9 6 (sum = 9 × 2^64 + 6)\n\nlet (a1, a0): (usize, usize) = (3, usize::MAX);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet carry0 = false;\n\nlet (sum0, carry1) = a0.carrying_add(b0, carry0);\nassert_eq!(carry1, true);\nlet (sum1, carry2) = a1.carrying_add(b1, carry1);\nassert_eq!(carry2, false);\n\nassert_eq!((sum1, sum0), (9, 6));
\n1.66.0 (const: 1.66.0) · sourcepub const fn overflowing_add_signed(self, rhs: isize) -> (usize, bool)
Calculates self
+ rhs
with a signed rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.overflowing_add_signed(2), (3, false));\nassert_eq!(1usize.overflowing_add_signed(-2), (usize::MAX, true));\nassert_eq!((usize::MAX - 2).overflowing_add_signed(4), (1, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_sub(self, rhs: usize) -> (usize, bool)
Calculates self
- rhs
\nReturns a tuple of the subtraction along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_sub(2), (3, false));\nassert_eq!(0usize.overflowing_sub(1), (usize::MAX, true));
\nsourcepub const fn borrowing_sub(self, rhs: usize, borrow: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
− rhs
− borrow
and returns a tuple\ncontaining the difference and the output borrow.
\nPerforms “ternary subtraction” by subtracting both an integer\noperand and a borrow-in bit from self
, and returns an output\ninteger and a borrow-out bit. This allows chaining together multiple\nsubtractions to create a wider subtraction, and can be useful for\nbignum subtraction.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 9 6 (a = 9 × 2^64 + 6)\n// - 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 3 MAX (diff = 3 × 2^64 + 2^64 - 1)\n\nlet (a1, a0): (usize, usize) = (9, 6);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet borrow0 = false;\n\nlet (diff0, borrow1) = a0.borrowing_sub(b0, borrow0);\nassert_eq!(borrow1, true);\nlet (diff1, borrow2) = a1.borrowing_sub(b1, borrow1);\nassert_eq!(borrow2, false);\n\nassert_eq!((diff1, diff0), (3, usize::MAX));
\n1.60.0 (const: 1.60.0) · sourcepub const fn abs_diff(self, other: usize) -> usize
Computes the absolute difference between self
and other
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.abs_diff(80), 20usize);\nassert_eq!(100usize.abs_diff(110), 10usize);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_mul(self, rhs: usize) -> (usize, bool)
Calculates the multiplication of self
and rhs
.
\nReturns a tuple of the multiplication along with a boolean\nindicating whether an arithmetic overflow would occur. If an\noverflow would have occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\nassert_eq!(5u32.overflowing_mul(2), (10, false));\nassert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_div(self, rhs: usize) -> (usize, bool)
Calculates the divisor when self
is divided by rhs
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div(2), (2, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.overflowing_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div_euclid(2), (2, false));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_rem(self, rhs: usize) -> (usize, bool)
Calculates the remainder when self
is divided by rhs
.
\nReturns a tuple of the remainder after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem(2), (1, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Calculates the remainder self.rem_euclid(rhs)
as if by Euclidean division.
\nReturns a tuple of the modulo after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this operation\nis exactly equal to self.overflowing_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem_euclid(2), (1, false));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_neg(self) -> (usize, bool)
Negates self in an overflowing fashion.
\nReturns !self + 1
using wrapping operations to return the value\nthat represents the negation of this unsigned value. Note that for\npositive unsigned values overflow always occurs, but negating 0 does\nnot overflow.
\n§Examples
\nBasic usage
\n\nassert_eq!(0usize.overflowing_neg(), (0, false));\nassert_eq!(2usize.overflowing_neg(), (-2i32 as usize, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shl(self, rhs: u32) -> (usize, bool)
Shifts self left by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x1usize.overflowing_shl(4), (0x10, false));\nassert_eq!(0x1usize.overflowing_shl(132), (0x10, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shr(self, rhs: u32) -> (usize, bool)
Shifts self right by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x10usize.overflowing_shr(4), (0x1, false));\nassert_eq!(0x10usize.overflowing_shr(132), (0x1, true));
\n1.34.0 (const: 1.50.0) · sourcepub const fn overflowing_pow(self, exp: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring.
\nReturns a tuple of the exponentiation along with a bool indicating\nwhether an overflow happened.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.overflowing_pow(5), (243, false));\nassert_eq!(3u8.overflowing_pow(6), (217, true));
\n1.0.0 (const: 1.50.0) · sourcepub const fn pow(self, exp: u32) -> usize
Raises self to the power of exp
, using exponentiation by squaring.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.pow(5), 32);
\nsourcepub const fn isqrt(self) -> usize
🔬This is a nightly-only experimental API. (isqrt
)
Returns the square root of the number, rounded down.
\n§Examples
\nBasic usage:
\n\n#![feature(isqrt)]\nassert_eq!(10usize.isqrt(), 3);
\n1.38.0 (const: 1.52.0) · sourcepub const fn div_euclid(self, rhs: usize) -> usize
1.38.0 (const: 1.52.0) · sourcepub const fn rem_euclid(self, rhs: usize) -> usize
Calculates the least remainder of self (mod rhs)
.
\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self % rhs
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(7usize.rem_euclid(4), 3); // or any other integer type
\nsourcepub const fn div_floor(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (int_roundings
)
Calculates the quotient of self
and rhs
, rounding the result towards negative infinity.
\nThis is the same as performing self / rhs
for all unsigned integers.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(int_roundings)]\nassert_eq!(7_usize.div_floor(4), 1);
\n1.73.0 (const: 1.73.0) · sourcepub const fn next_multiple_of(self, rhs: usize) -> usize
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Overflow behavior
\nOn overflow, this function will panic if overflow checks are enabled (default in debug\nmode) and wrap if overflow checks are disabled (default in release mode).
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.next_multiple_of(8), 16);\nassert_eq!(23_usize.next_multiple_of(8), 24);
\n1.73.0 (const: 1.73.0) · sourcepub const fn checked_next_multiple_of(self, rhs: usize) -> Option<usize>
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
. Returns None
if rhs
is zero or the\noperation would result in overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.checked_next_multiple_of(8), Some(16));\nassert_eq!(23_usize.checked_next_multiple_of(8), Some(24));\nassert_eq!(1_usize.checked_next_multiple_of(0), None);\nassert_eq!(usize::MAX.checked_next_multiple_of(2), None);
\n1.0.0 (const: 1.32.0) · sourcepub const fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.
\n§Examples
\nBasic usage:
\n\nassert!(16usize.is_power_of_two());\nassert!(!10usize.is_power_of_two());
\n1.0.0 (const: 1.50.0) · sourcepub const fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
.
\nWhen return value overflows (i.e., self > (1 << (N-1))
for type\nuN
), it panics in debug mode and the return value is wrapped to 0 in\nrelease mode (the only situation in which this method can return 0).
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.next_power_of_two(), 2);\nassert_eq!(3usize.next_power_of_two(), 4);\nassert_eq!(0usize.next_power_of_two(), 1);
\n1.0.0 (const: 1.50.0) · sourcepub const fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to self
. If\nthe next power of two is greater than the type’s maximum value,\nNone
is returned, otherwise the power of two is wrapped in Some
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_next_power_of_two(), Some(2));\nassert_eq!(3usize.checked_next_power_of_two(), Some(4));\nassert_eq!(usize::MAX.checked_next_power_of_two(), None);
\nsourcepub const fn wrapping_next_power_of_two(self) -> usize
🔬This is a nightly-only experimental API. (wrapping_next_power_of_two
)
Returns the smallest power of two greater than or equal to n
. If\nthe next power of two is greater than the type’s maximum value,\nthe return value is wrapped to 0
.
\n§Examples
\nBasic usage:
\n\n#![feature(wrapping_next_power_of_two)]\n\nassert_eq!(2usize.wrapping_next_power_of_two(), 2);\nassert_eq!(3usize.wrapping_next_power_of_two(), 4);\nassert_eq!(usize::MAX.wrapping_next_power_of_two(), 0);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_be_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nbig-endian (network) byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_be_bytes();\nassert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_le_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nlittle-endian byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_le_bytes();\nassert_eq!(bytes, [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_ne_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nnative byte order.
\nAs the target platform’s native endianness is used, portable code\nshould use to_be_bytes
or to_le_bytes
, as appropriate,\ninstead.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_ne_bytes();\nassert_eq!(\n bytes,\n if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n } else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n }\n);
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_be_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in big endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_be_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_be_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_le_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in little endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_le_bytes([0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_le_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_le_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_ne_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its memory representation\nas a byte array in native endianness.
\nAs the target platform’s native endianness is used, portable code\nlikely wants to use from_be_bytes
or from_le_bytes
, as\nappropriate instead.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_ne_bytes(if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n} else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n});\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_ne_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_ne_bytes(int_bytes.try_into().unwrap())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn min_value() -> usize
👎Deprecating in a future version: replaced by the MIN
associated constant on this type
New code should prefer to use\nusize::MIN
instead.
\nReturns the smallest value that can be represented by this integer type.
\n1.0.0 (const: 1.32.0) · sourcepub const fn max_value() -> usize
👎Deprecating in a future version: replaced by the MAX
associated constant on this type
New code should prefer to use\nusize::MAX
instead.
\nReturns the largest value that can be represented by this integer type.
\nsourcepub const fn widening_mul(self, rhs: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the complete product self * rhs
without the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nIf you also need to add a carry to the wide result, then you want\nSelf::carrying_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.widening_mul(2), (10, 0));\nassert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));
\nsourcepub const fn carrying_mul(self, rhs: usize, carry: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the “full multiplication” self * rhs + carry
\nwithout the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nPerforms “long multiplication” which takes in an extra amount to add, and may return an\nadditional amount of overflow. This allows for chaining together multiple\nmultiplications to create “big integers” which represent larger values.
\nIf you don’t need the carry
, then you can use Self::widening_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.carrying_mul(2, 0), (10, 0));\nassert_eq!(5u32.carrying_mul(2, 10), (20, 0));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));\nassert_eq!(usize::MAX.carrying_mul(usize::MAX, usize::MAX), (0, usize::MAX));
\nThis is the core operation needed for scalar multiplication when\nimplementing it for wider-than-native types.
\n\n#![feature(bigint_helper_methods)]\nfn scalar_mul_eq(little_endian_digits: &mut Vec<u16>, multiplicand: u16) {\n let mut carry = 0;\n for d in little_endian_digits.iter_mut() {\n (*d, carry) = d.carrying_mul(multiplicand, carry);\n }\n if carry != 0 {\n little_endian_digits.push(carry);\n }\n}\n\nlet mut v = vec![10, 20];\nscalar_mul_eq(&mut v, 3);\nassert_eq!(v, [30, 60]);\n\nassert_eq!(0x87654321_u64 * 0xFEED, 0x86D3D159E38D);\nlet mut v = vec![0x4321, 0x8765];\nscalar_mul_eq(&mut v, 0xFEED);\nassert_eq!(v, [0xE38D, 0xD159, 0x86D3]);
\nIf carry
is zero, this is similar to overflowing_mul
,\nexcept that it gives the value of the overflow instead of just whether one happened:
\n\n#![feature(bigint_helper_methods)]\nlet r = u8::carrying_mul(7, 13, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));\nlet r = u8::carrying_mul(13, 42, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(13, 42));
\nThe value of the first field in the returned tuple matches what you’d get\nby combining the wrapping_mul
and\nwrapping_add
methods:
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(\n 789_u16.carrying_mul(456, 123).0,\n 789_u16.wrapping_mul(456).wrapping_add(123),\n);
\nsourcepub const fn midpoint(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (num_midpoint
)
Calculates the middle point of self
and rhs
.
\nmidpoint(a, b)
is (a + b) >> 1
as if it were performed in a\nsufficiently-large signed integral type. This implies that the result is\nalways rounded towards negative infinity and that no overflow will ever occur.
\n§Examples
\n#![feature(num_midpoint)]\nassert_eq!(0usize.midpoint(4), 2);\nassert_eq!(1usize.midpoint(4), 2);
\n",0,"gosling::context::HandshakeHandle"],["source§impl usize
1.0.0 (const: unstable) · sourcepub fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer.
\nThe string is expected to be an optional +
sign\nfollowed by digits.\nLeading and trailing whitespace represent an error.\nDigits are a subset of these characters, depending on radix
:
\n\n0-9
\na-z
\nA-Z
\n
\n§Panics
\nThis function panics if radix
is not in the range from 2 to 36.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::from_str_radix(\"A\", 16), Ok(10));
\n",0,"gosling::context::HandshakeHandle"],["§impl AtLeast16 for usize
","AtLeast16","gosling::context::HandshakeHandle"],["§impl AtLeast32 for usize
","AtLeast32","gosling::context::HandshakeHandle"],["§impl AtLeast64 for usize
","AtLeast64","gosling::context::HandshakeHandle"],["§impl AtLeast8 for usize
","AtLeast8","gosling::context::HandshakeHandle"],["§impl AtMost128 for usize
","AtMost128","gosling::context::HandshakeHandle"],["§impl AtMost64 for usize
","AtMost64","gosling::context::HandshakeHandle"],["§impl BitOps for usize
","BitOps","gosling::context::HandshakeHandle"],["source§impl ConstParamTy for usize
","ConstParamTy","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Copy for usize
","Copy","gosling::context::HandshakeHandle"],["§impl DefaultIsZeroes for usize
","DefaultIsZeroes","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Eq for usize
","Eq","gosling::context::HandshakeHandle"],["§impl ExtendTarget<usize> for usize
","ExtendTarget","gosling::context::HandshakeHandle"],["source§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["source§impl Integer for usize
","Integer","gosling::context::HandshakeHandle"],["§impl Is64 for usize
","Is64","gosling::context::HandshakeHandle"],["§impl NotAutoValue for usize
","NotAutoValue","gosling::context::HandshakeHandle"],["§impl NumericOps for usize
","NumericOps","gosling::context::HandshakeHandle"],["source§impl SimdCast for usize
","SimdCast","gosling::context::HandshakeHandle"],["source§impl StructuralPartialEq for usize
","StructuralPartialEq","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u16> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u8> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<usize> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["source§impl TrustedStep for usize
","TrustedStep","gosling::context::HandshakeHandle"],["§impl Uint for usize
","Uint","gosling::context::HandshakeHandle"],["source§impl Unsigned for usize
","Unsigned","gosling::context::HandshakeHandle"],["source§impl Weight for usize
","Weight","gosling::context::HandshakeHandle"],["source§impl ZeroablePrimitive for usize
","ZeroablePrimitive","gosling::context::HandshakeHandle"]],
-"tor_interface":[["","Accumulate","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Add<&usize>","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","tor_interface::tor_provider::CircuitToken"],["","AsAny","tor_interface::tor_provider::CircuitToken"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["","Binary","tor_interface::tor_provider::CircuitToken"],["","BitAnd<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitAnd","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","tor_interface::tor_provider::CircuitToken"],["","BitOr<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitOr","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","tor_interface::tor_provider::CircuitToken"],["","BitRegister","tor_interface::tor_provider::CircuitToken"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","tor_interface::tor_provider::CircuitToken"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","tor_interface::tor_provider::CircuitToken"],["","BitXor<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitXor","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","tor_interface::tor_provider::CircuitToken"],["","Bits","tor_interface::tor_provider::CircuitToken"],["","Bounded","tor_interface::tor_provider::CircuitToken"],["","CastSigned","tor_interface::tor_provider::CircuitToken"],["","CastUnsigned","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedAdd for usize
","CheckedAdd","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedDiv for usize
","CheckedDiv","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedMul for usize
","CheckedMul","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedNeg for usize
","CheckedNeg","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedRem for usize
","CheckedRem","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShl for usize
","CheckedShl","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShr for usize
","CheckedShr","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedSub for usize
","CheckedSub","tor_interface::tor_provider::CircuitToken"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","tor_interface::tor_provider::CircuitToken"],["","Clone","tor_interface::tor_provider::CircuitToken"],["","ConstOne","tor_interface::tor_provider::CircuitToken"],["","ConstZero","tor_interface::tor_provider::CircuitToken"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","tor_interface::tor_provider::CircuitToken"],["","Debug","tor_interface::tor_provider::CircuitToken"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","tor_interface::tor_provider::CircuitToken"],["","Default","tor_interface::tor_provider::CircuitToken"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","tor_interface::tor_provider::CircuitToken"],["","Display","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Div<&usize>","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","tor_interface::tor_provider::CircuitToken"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","tor_interface::tor_provider::CircuitToken"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","tor_interface::tor_provider::CircuitToken"],["","FmtConst","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","tor_interface::tor_provider::CircuitToken"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","tor_interface::tor_provider::CircuitToken"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","tor_interface::tor_provider::CircuitToken"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","tor_interface::tor_provider::CircuitToken"],["","FromStr","tor_interface::tor_provider::CircuitToken"],["","FromZeroes","tor_interface::tor_provider::CircuitToken"],["","Fundamental","tor_interface::tor_provider::CircuitToken"],["","Hash","tor_interface::tor_provider::CircuitToken"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","tor_interface::tor_provider::CircuitToken"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","tor_interface::tor_provider::CircuitToken"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","tor_interface::tor_provider::CircuitToken"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","tor_interface::tor_provider::CircuitToken"],["","LowerExp","tor_interface::tor_provider::CircuitToken"],["","LowerHex","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Mul<&usize>","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","MulAdd","tor_interface::tor_provider::CircuitToken"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","tor_interface::tor_provider::CircuitToken"],["","Not","tor_interface::tor_provider::CircuitToken"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","tor_interface::tor_provider::CircuitToken"],["","NumCast","tor_interface::tor_provider::CircuitToken"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","tor_interface::tor_provider::CircuitToken"],["","Octal","tor_interface::tor_provider::CircuitToken"],["","One","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Ord for usize
","Ord","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingAdd for usize
","OverflowingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingMul for usize
","OverflowingMul","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingSub for usize
","OverflowingSub","tor_interface::tor_provider::CircuitToken"],["","ParseHex","tor_interface::tor_provider::CircuitToken"],["source§impl PartialEq<Value> for usize
","PartialEq","tor_interface::tor_provider::CircuitToken"],["","PartialEq","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","tor_interface::tor_provider::CircuitToken"],["","PhfBorrow","tor_interface::tor_provider::CircuitToken"],["","PhfHash","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u16>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u32>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u8>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","tor_interface::tor_provider::CircuitToken"],["","Product<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Product","tor_interface::tor_provider::CircuitToken"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Rem<&usize>","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","tor_interface::tor_provider::CircuitToken"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["source§impl Roots for usize
","Roots","tor_interface::tor_provider::CircuitToken"],["","RowIndex","tor_interface::tor_provider::CircuitToken"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","tor_interface::tor_provider::CircuitToken"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","tor_interface::tor_provider::CircuitToken"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","tor_interface::tor_provider::CircuitToken"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","tor_interface::tor_provider::CircuitToken"],["","Shl<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["","Shr<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["
Enum tor_interface::tor_provider::OnionAddr
source · pub enum OnionAddr {
V3(OnionAddrV3),
}
Expand description
An onion service address analog to std::net::SocketAddr
Variants§
V3(OnionAddrV3)
Trait Implementations§
source§impl Hash for OnionAddr
impl Hash for OnionAddr
1.3.0 · source§fn hash_slice<H>(data: &[Self], state: &mut H)where
+
fn hash_slice<H>(data: &[Self], state: &mut H)where
+
Variants§
V3(OnionAddrV3)
Trait Implementations§
source§impl Ord for OnionAddr
impl Ord for OnionAddr
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/tor_interface/tor_provider/struct.DomainAddr.html b/crates/tor_interface/tor_provider/struct.DomainAddr.html
index 9093e21e..c541ef98 100644
--- a/crates/tor_interface/tor_provider/struct.DomainAddr.html
+++ b/crates/tor_interface/tor_provider/struct.DomainAddr.html
@@ -3,7 +3,7 @@
fn min(self, other: Self) -> Selfwhere
diff --git a/crates/tor_interface/tor_provider/struct.DomainAddr.html b/crates/tor_interface/tor_provider/struct.DomainAddr.html
index 9093e21e..c541ef98 100644
--- a/crates/tor_interface/tor_provider/struct.DomainAddr.html
+++ b/crates/tor_interface/tor_provider/struct.DomainAddr.html
@@ -3,7 +3,7 @@
Implementations§
Trait Implementations§
source§impl Clone for DomainAddr
impl Clone for DomainAddr
source§fn clone(&self) -> DomainAddr
fn clone(&self) -> DomainAddr
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DomainAddr
impl Debug for DomainAddr
source§impl Display for DomainAddr
impl Display for DomainAddr
source§impl FromStr for DomainAddr
impl FromStr for DomainAddr
Trait Implementations§
source§impl Clone for DomainAddr
impl Clone for DomainAddr
source§fn clone(&self) -> DomainAddr
fn clone(&self) -> DomainAddr
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DomainAddr
impl Debug for DomainAddr
source§impl Display for DomainAddr
impl Display for DomainAddr
source§impl FromStr for DomainAddr
impl FromStr for DomainAddr
source§impl Hash for DomainAddr
impl Hash for DomainAddr
source§impl Ord for DomainAddr
impl Ord for DomainAddr
source§fn cmp(&self, other: &DomainAddr) -> Ordering
fn cmp(&self, other: &DomainAddr) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · source§fn min(self, other: Self) -> Selfwhere
diff --git a/crates/type.impl/std/primitive.usize.js b/crates/type.impl/std/primitive.usize.js
index da014e4e..ef01c053 100644
--- a/crates/type.impl/std/primitive.usize.js
+++ b/crates/type.impl/std/primitive.usize.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
-"gosling":[["","Accumulate","gosling::context::HandshakeHandle"],["","Add<&'a BigInt>","gosling::context::HandshakeHandle"],["","Add<&'a BigUint>","gosling::context::HandshakeHandle"],["","Add<&usize>","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","gosling::context::HandshakeHandle"],["","AsAny","gosling::context::HandshakeHandle"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["","Binary","gosling::context::HandshakeHandle"],["","BitAnd<&usize>","gosling::context::HandshakeHandle"],["","BitAnd","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","gosling::context::HandshakeHandle"],["","BitOr<&usize>","gosling::context::HandshakeHandle"],["","BitOr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","gosling::context::HandshakeHandle"],["","BitRegister","gosling::context::HandshakeHandle"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","gosling::context::HandshakeHandle"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","gosling::context::HandshakeHandle"],["","BitXor<&usize>","gosling::context::HandshakeHandle"],["","BitXor","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","gosling::context::HandshakeHandle"],["","Bits","gosling::context::HandshakeHandle"],["","Bounded","gosling::context::HandshakeHandle"],["","CastSigned","gosling::context::HandshakeHandle"],["","CastUnsigned","gosling::context::HandshakeHandle"],["source§impl CheckedAdd for usize
","CheckedAdd","gosling::context::HandshakeHandle"],["source§impl CheckedDiv for usize
","CheckedDiv","gosling::context::HandshakeHandle"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","gosling::context::HandshakeHandle"],["source§impl CheckedMul for usize
","CheckedMul","gosling::context::HandshakeHandle"],["source§impl CheckedNeg for usize
","CheckedNeg","gosling::context::HandshakeHandle"],["source§impl CheckedRem for usize
","CheckedRem","gosling::context::HandshakeHandle"],["source§impl CheckedShl for usize
","CheckedShl","gosling::context::HandshakeHandle"],["source§impl CheckedShr for usize
","CheckedShr","gosling::context::HandshakeHandle"],["source§impl CheckedSub for usize
","CheckedSub","gosling::context::HandshakeHandle"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","gosling::context::HandshakeHandle"],["","Clone","gosling::context::HandshakeHandle"],["","ConstOne","gosling::context::HandshakeHandle"],["","ConstZero","gosling::context::HandshakeHandle"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","gosling::context::HandshakeHandle"],["","Debug","gosling::context::HandshakeHandle"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","gosling::context::HandshakeHandle"],["","Default","gosling::context::HandshakeHandle"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","gosling::context::HandshakeHandle"],["","Display","gosling::context::HandshakeHandle"],["","Div<&'a BigInt>","gosling::context::HandshakeHandle"],["","Div<&'a BigUint>","gosling::context::HandshakeHandle"],["","Div<&usize>","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","gosling::context::HandshakeHandle"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","gosling::context::HandshakeHandle"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","gosling::context::HandshakeHandle"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","gosling::context::HandshakeHandle"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","gosling::context::HandshakeHandle"],["","FmtConst","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","gosling::context::HandshakeHandle"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","gosling::context::HandshakeHandle"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","gosling::context::HandshakeHandle"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","gosling::context::HandshakeHandle"],["","FromStr","gosling::context::HandshakeHandle"],["","FromZeroes","gosling::context::HandshakeHandle"],["","Fundamental","gosling::context::HandshakeHandle"],["","Hash","gosling::context::HandshakeHandle"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","gosling::context::HandshakeHandle"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","gosling::context::HandshakeHandle"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","gosling::context::HandshakeHandle"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","gosling::context::HandshakeHandle"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","gosling::context::HandshakeHandle"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","gosling::context::HandshakeHandle"],["","LowerExp","gosling::context::HandshakeHandle"],["","LowerHex","gosling::context::HandshakeHandle"],["","Mul<&'a BigInt>","gosling::context::HandshakeHandle"],["","Mul<&'a BigUint>","gosling::context::HandshakeHandle"],["","Mul<&usize>","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","MulAdd","gosling::context::HandshakeHandle"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","gosling::context::HandshakeHandle"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","gosling::context::HandshakeHandle"],["","Not","gosling::context::HandshakeHandle"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","gosling::context::HandshakeHandle"],["","NumCast","gosling::context::HandshakeHandle"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","gosling::context::HandshakeHandle"],["","Octal","gosling::context::HandshakeHandle"],["","One","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Ord for usize
","Ord","gosling::context::HandshakeHandle"],["source§impl OverflowingAdd for usize
","OverflowingAdd","gosling::context::HandshakeHandle"],["source§impl OverflowingMul for usize
","OverflowingMul","gosling::context::HandshakeHandle"],["source§impl OverflowingSub for usize
","OverflowingSub","gosling::context::HandshakeHandle"],["","ParseHex","gosling::context::HandshakeHandle"],["source§impl PartialEq<Value> for usize
","PartialEq","gosling::context::HandshakeHandle"],["","PartialEq","gosling::context::HandshakeHandle"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","gosling::context::HandshakeHandle"],["","PhfBorrow","gosling::context::HandshakeHandle"],["","PhfHash","gosling::context::HandshakeHandle"],["","Pow<&'a u16>","gosling::context::HandshakeHandle"],["","Pow<&'a u32>","gosling::context::HandshakeHandle"],["","Pow<&'a u8>","gosling::context::HandshakeHandle"],["","Pow<&'a usize>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","gosling::context::HandshakeHandle"],["","Product<&'a usize>","gosling::context::HandshakeHandle"],["","Product","gosling::context::HandshakeHandle"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","gosling::context::HandshakeHandle"],["","Rem<&'a BigInt>","gosling::context::HandshakeHandle"],["","Rem<&'a BigUint>","gosling::context::HandshakeHandle"],["","Rem<&usize>","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","gosling::context::HandshakeHandle"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","gosling::context::HandshakeHandle"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["source§impl Roots for usize
","Roots","gosling::context::HandshakeHandle"],["","RowIndex","gosling::context::HandshakeHandle"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","gosling::context::HandshakeHandle"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","gosling::context::HandshakeHandle"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","gosling::context::HandshakeHandle"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","gosling::context::HandshakeHandle"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","gosling::context::HandshakeHandle"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","gosling::context::HandshakeHandle"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","gosling::context::HandshakeHandle"],["","Shl<&i128>","gosling::context::HandshakeHandle"],["","Shl<&i16>","gosling::context::HandshakeHandle"],["","Shl<&i32>","gosling::context::HandshakeHandle"],["","Shl<&i64>","gosling::context::HandshakeHandle"],["","Shl<&i8>","gosling::context::HandshakeHandle"],["","Shl<&isize>","gosling::context::HandshakeHandle"],["","Shl<&u128>","gosling::context::HandshakeHandle"],["","Shl<&u16>","gosling::context::HandshakeHandle"],["","Shl<&u32>","gosling::context::HandshakeHandle"],["","Shl<&u64>","gosling::context::HandshakeHandle"],["","Shl<&u8>","gosling::context::HandshakeHandle"],["","Shl<&usize>","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["","Shr<&i128>","gosling::context::HandshakeHandle"],["","Shr<&i16>","gosling::context::HandshakeHandle"],["","Shr<&i32>","gosling::context::HandshakeHandle"],["","Shr<&i64>","gosling::context::HandshakeHandle"],["","Shr<&i8>","gosling::context::HandshakeHandle"],["","Shr<&isize>","gosling::context::HandshakeHandle"],["","Shr<&u128>","gosling::context::HandshakeHandle"],["","Shr<&u16>","gosling::context::HandshakeHandle"],["","Shr<&u32>","gosling::context::HandshakeHandle"],["","Shr<&u64>","gosling::context::HandshakeHandle"],["","Shr<&u8>","gosling::context::HandshakeHandle"],["","Shr<&usize>","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i128> for usize
source§fn shr_assign(&mut self, other: &i128)
Performs the >>=
operation. Read more","ShrAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i16> for usize
source§fn shr_assign(&mut self, other: &i16)
Performs the >>=
operation. Read more","ShrAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i32> for usize
source§fn shr_assign(&mut self, other: &i32)
Performs the >>=
operation. Read more","ShrAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i64> for usize
source§fn shr_assign(&mut self, other: &i64)
Performs the >>=
operation. Read more","ShrAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i8> for usize
source§fn shr_assign(&mut self, other: &i8)
Performs the >>=
operation. Read more","ShrAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&isize> for usize
source§fn shr_assign(&mut self, other: &isize)
Performs the >>=
operation. Read more","ShrAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u128> for usize
source§fn shr_assign(&mut self, other: &u128)
Performs the >>=
operation. Read more","ShrAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u16> for usize
source§fn shr_assign(&mut self, other: &u16)
Performs the >>=
operation. Read more","ShrAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u32> for usize
source§fn shr_assign(&mut self, other: &u32)
Performs the >>=
operation. Read more","ShrAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u64> for usize
source§fn shr_assign(&mut self, other: &u64)
Performs the >>=
operation. Read more","ShrAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u8> for usize
source§fn shr_assign(&mut self, other: &u8)
Performs the >>=
operation. Read more","ShrAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&usize> for usize
source§fn shr_assign(&mut self, other: &usize)
Performs the >>=
operation. Read more","ShrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i128> for usize
source§fn shr_assign(&mut self, other: i128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i16> for usize
source§fn shr_assign(&mut self, other: i16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i32> for usize
source§fn shr_assign(&mut self, other: i32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i64> for usize
source§fn shr_assign(&mut self, other: i64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i8> for usize
source§fn shr_assign(&mut self, other: i8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<isize> for usize
source§fn shr_assign(&mut self, other: isize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u128> for usize
source§fn shr_assign(&mut self, other: u128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u16> for usize
source§fn shr_assign(&mut self, other: u16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u32> for usize
source§fn shr_assign(&mut self, other: u32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u64> for usize
source§fn shr_assign(&mut self, other: u64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u8> for usize
source§fn shr_assign(&mut self, other: u8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign for usize
source§fn shr_assign(&mut self, other: usize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["source§impl SimdElement for usize
","SimdElement","gosling::context::HandshakeHandle"],["1.15.0 (const: unstable) · source§impl<T> SliceIndex<[T]> for usize
The methods index
and index_mut
panic if the index is out of bounds.
\nsource§fn get(self, slice: &[T]) -> Option<&T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a shared reference to the output at this location, if in\nbounds.source§fn get_mut(self, slice: &mut [T]) -> Option<&mut T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable reference to the output at this location, if in\nbounds.source§unsafe fn get_unchecked(self, slice: *const [T]) -> *const T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.source§unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.","SliceIndex<[T]>","gosling::context::HandshakeHandle"],["§impl SmartDisplay for usize
§fn metadata(&self, f: FormatterOptions) -> Metadata<'_, usize>
Compute any information needed to format the value. This must, at a minimum, determine the\nwidth of the value before any padding is added by the formatter. Read more§fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Format the value using the given formatter. This is the same as Display::fmt
. Read more§fn fmt_with_metadata(\n &self,\n f: &mut Formatter<'_>,\n _metadata: Metadata<'_, Self>,\n) -> Result<(), Error>
Format the value using the given formatter and metadata. The formatted output should have\nthe width indicated by the metadata. This is before any padding is added by the\nformatter. Read more","SmartDisplay","gosling::context::HandshakeHandle"],["source§impl Step for usize
source§fn forward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn backward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn forward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn backward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn steps_between(start: &usize, end: &usize) -> Option<usize>
🔬This is a nightly-only experimental API. (step_trait
)","Step","gosling::context::HandshakeHandle"],["","Sub<&'a BigInt>","gosling::context::HandshakeHandle"],["","Sub<&'a BigUint>","gosling::context::HandshakeHandle"],["","Sub<&usize>","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["1.22.0 · source§impl SubAssign<&usize> for usize
source§fn sub_assign(&mut self, other: &usize)
Performs the -=
operation. Read more","SubAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl SubAssign for usize
source§fn sub_assign(&mut self, other: usize)
Performs the -=
operation. Read more","SubAssign","gosling::context::HandshakeHandle"],["","Sum<&'a usize>","gosling::context::HandshakeHandle"],["","Sum","gosling::context::HandshakeHandle"],["","ToBigInt","gosling::context::HandshakeHandle"],["source§impl ToBigUint for usize
source§fn to_biguint(&self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","ToBigUint","gosling::context::HandshakeHandle"],["source§impl ToBytes for usize
§type Bytes = [u8; 8]
source§fn to_be_bytes(&self) -> <usize as ToBytes>::Bytes
Return the memory representation of this number as a byte array in big-endian byte order. Read more","ToBytes","gosling::context::HandshakeHandle"],["source§impl ToPrimitive for usize
source§fn to_isize(&self) -> Option<isize>
Converts the value of self
to an isize
. If the value cannot be\nrepresented by an isize
, then None
is returned.source§fn to_i8(&self) -> Option<i8>
Converts the value of self
to an i8
. If the value cannot be\nrepresented by an i8
, then None
is returned.source§fn to_i16(&self) -> Option<i16>
Converts the value of self
to an i16
. If the value cannot be\nrepresented by an i16
, then None
is returned.source§fn to_i32(&self) -> Option<i32>
Converts the value of self
to an i32
. If the value cannot be\nrepresented by an i32
, then None
is returned.source§fn to_i64(&self) -> Option<i64>
Converts the value of self
to an i64
. If the value cannot be\nrepresented by an i64
, then None
is returned.source§fn to_i128(&self) -> Option<i128>
Converts the value of self
to an i128
. If the value cannot be\nrepresented by an i128
(i64
under the default implementation), then\nNone
is returned. Read moresource§fn to_usize(&self) -> Option<usize>
Converts the value of self
to a usize
. If the value cannot be\nrepresented by a usize
, then None
is returned.source§fn to_u8(&self) -> Option<u8>
Converts the value of self
to a u8
. If the value cannot be\nrepresented by a u8
, then None
is returned.source§fn to_u16(&self) -> Option<u16>
Converts the value of self
to a u16
. If the value cannot be\nrepresented by a u16
, then None
is returned.source§fn to_u32(&self) -> Option<u32>
Converts the value of self
to a u32
. If the value cannot be\nrepresented by a u32
, then None
is returned.source§fn to_u64(&self) -> Option<u64>
Converts the value of self
to a u64
. If the value cannot be\nrepresented by a u64
, then None
is returned.source§fn to_u128(&self) -> Option<u128>
Converts the value of self
to a u128
. If the value cannot be\nrepresented by a u128
(u64
under the default implementation), then\nNone
is returned. Read more","ToPrimitive","gosling::context::HandshakeHandle"],["","ToSql","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","TryFrom>","gosling::context::HandshakeHandle"],["","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i128> for usize
source§fn try_from(u: i128) -> Result<usize, <usize as TryFrom<i128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i16> for usize
source§fn try_from(u: i16) -> Result<usize, <usize as TryFrom<i16>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i32> for usize
source§fn try_from(u: i32) -> Result<usize, <usize as TryFrom<i32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i64> for usize
source§fn try_from(u: i64) -> Result<usize, <usize as TryFrom<i64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i8> for usize
source§fn try_from(u: i8) -> Result<usize, <usize as TryFrom<i8>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<isize> for usize
source§fn try_from(u: isize) -> Result<usize, <usize as TryFrom<isize>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u128> for usize
source§fn try_from(u: u128) -> Result<usize, <usize as TryFrom<u128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u32> for usize
source§fn try_from(value: u32) -> Result<usize, <usize as TryFrom<u32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u64> for usize
source§fn try_from(value: u64) -> Result<usize, <usize as TryFrom<u64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["§impl Unsigned for usize
§fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.§fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
. Read more§fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to n
. If the\nnext power of two is greater than the type’s maximum value, None
is\nreturned, otherwise the power of two is wrapped in Some
.","Unsigned","gosling::context::HandshakeHandle"],["","UpperExp","gosling::context::HandshakeHandle"],["","UpperHex","gosling::context::HandshakeHandle"],["","Value","gosling::context::HandshakeHandle"],["source§impl WrappingAdd for usize
source§fn wrapping_add(&self, v: &usize) -> usize
Wrapping (modular) addition. Computes self + other
, wrapping around at the boundary of\nthe type.","WrappingAdd","gosling::context::HandshakeHandle"],["source§impl WrappingMul for usize
source§fn wrapping_mul(&self, v: &usize) -> usize
Wrapping (modular) multiplication. Computes self * other
, wrapping around at the boundary\nof the type.","WrappingMul","gosling::context::HandshakeHandle"],["source§impl WrappingNeg for usize
source§fn wrapping_neg(&self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type. Read more","WrappingNeg","gosling::context::HandshakeHandle"],["source§impl WrappingShl for usize
","WrappingShl","gosling::context::HandshakeHandle"],["source§impl WrappingShr for usize
","WrappingShr","gosling::context::HandshakeHandle"],["source§impl WrappingSub for usize
source§fn wrapping_sub(&self, v: &usize) -> usize
Wrapping (modular) subtraction. Computes self - other
, wrapping around at the boundary\nof the type.","WrappingSub","gosling::context::HandshakeHandle"],["","WriteHex","gosling::context::HandshakeHandle"],["§impl Writeable for usize
§fn write_to<W>(&self, sink: &mut W) -> Result<(), Error>
Writes a string to the given sink. Errors from the sink are bubbled up.\nThe default implementation delegates to write_to_parts
, and discards any\nPart
annotations.§fn writeable_length_hint(&self) -> LengthHint
Returns a hint for the number of UTF-8 bytes that will be written to the sink. Read more§fn write_to_parts<S>(&self, sink: &mut S) -> Result<(), Error>where\n S: PartsWrite + ?Sized,
Write bytes and Part
annotations to the given sink. Errors from the\nsink are bubbled up. The default implementation delegates to write_to
,\nand doesn’t produce any Part
annotations.§fn write_to_string(&self) -> Cow<'_, str>
Creates a new String
with the data from this Writeable
. Like ToString
,\nbut smaller and faster. Read more§fn writeable_cmp_bytes(&self, other: &[u8]) -> Ordering
Compares the contents of this Writeable
to the given bytes\nwithout allocating a String to hold the Writeable
contents. Read more","Writeable","gosling::context::HandshakeHandle"],["§impl<'a> Yokeable<'a> for usize
§fn transform_owned(self) -> <usize as Yokeable<'a>>::Output
§unsafe fn make(this: <usize as Yokeable<'a>>::Output) -> usize
This method can be used to cast away Self<'a>
’s lifetime. Read more§fn transform_mut<F>(&'a mut self, f: F)
This method must cast self
between &'a mut Self<'static>
and &'a mut Self<'a>
,\nand pass it to f
. Read more","Yokeable<'a>","gosling::context::HandshakeHandle"],["","Zero","gosling::context::HandshakeHandle"],["","ZeroFrom<'a, usize>","gosling::context::HandshakeHandle"],["§impl<'a> ZeroMapKV<'a> for usize
","ZeroMapKV<'a>","gosling::context::HandshakeHandle"],["source§impl usize
1.43.0 · sourcepub const MIN: usize = 0usize
The smallest value that can be represented by this integer type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MIN, 0);
\n1.43.0 · sourcepub const MAX: usize = 18_446_744_073_709_551_615usize
The largest value that can be represented by this integer type\n(264 − 1 on 64-bit targets).
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX, 18446744073709551615);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b01001100usize;\n\nassert_eq!(n.count_ones(), 3);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX.count_zeros(), 0);
\n1.0.0 (const: 1.32.0) · sourcepub const fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of self
.
\nDepending on what you’re doing with the value, you might also be interested in the\nilog2
function which returns a consistent number, even if the type widens.
\n§Examples
\nBasic usage:
\n\nlet n = usize::MAX >> 2;\n\nassert_eq!(n.leading_zeros(), 2);
\n1.0.0 (const: 1.32.0) · sourcepub const fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b0101000usize;\n\nassert_eq!(n.trailing_zeros(), 3);
\n1.46.0 (const: 1.46.0) · sourcepub const fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = !(usize::MAX >> 2);\n\nassert_eq!(n.leading_ones(), 2);
\n1.46.0 (const: 1.46.0) · sourcepub const fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b1010111usize;\n\nassert_eq!(n.trailing_ones(), 3);
\nsourcepub const fn cast_signed(self) -> isize
🔬This is a nightly-only experimental API. (integer_sign_cast
)
Returns the bit pattern of self
reinterpreted as a signed integer of the same size.
\nThis produces the same result as an as
cast, but ensures that the bit-width remains\nthe same.
\n§Examples
\nBasic usage:
\n\n#![feature(integer_sign_cast)]\n\nlet n = usize::MAX;\n\nassert_eq!(n.cast_signed(), -1isize);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
,\nwrapping the truncated bits to the end of the resulting integer.
\nPlease note this isn’t the same operation as the <<
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0xaa00000000006e1usize;\nlet m = 0x6e10aa;\n\nassert_eq!(n.rotate_left(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
,\nwrapping the truncated bits to the beginning of the resulting\ninteger.
\nPlease note this isn’t the same operation as the >>
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0x6e10aausize;\nlet m = 0xaa00000000006e1;\n\nassert_eq!(n.rotate_right(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn swap_bytes(self) -> usize
Reverses the byte order of the integer.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.swap_bytes();\n\nassert_eq!(m, 0x5634129078563412);
\n1.37.0 (const: 1.37.0) · sourcepub const fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit,\nsecond least-significant bit becomes second most-significant bit, etc.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.reverse_bits();\n\nassert_eq!(m, 0x6a2c48091e6a2c48);\nassert_eq!(0, 0usize.reverse_bits());
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_be(x: usize) -> usize
Converts an integer from big endian to the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(usize::from_be(n), n)\n} else {\n assert_eq!(usize::from_be(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_le(x: usize) -> usize
Converts an integer from little endian to the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(usize::from_le(n), n)\n} else {\n assert_eq!(usize::from_le(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_be(self) -> usize
Converts self
to big endian from the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(n.to_be(), n)\n} else {\n assert_eq!(n.to_be(), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_le(self) -> usize
Converts self
to little endian from the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(n.to_le(), n)\n} else {\n assert_eq!(n.to_le(), n.swap_bytes())\n}
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
\nif overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!((usize::MAX - 2).checked_add(1), Some(usize::MAX - 1));\nassert_eq!((usize::MAX - 2).checked_add(3), None);
\nsourcepub const fn strict_add(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer addition. Computes self + rhs
, panicking\nif overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!((usize::MAX - 2).strict_add(1), usize::MAX - 1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add(3);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_add(self, rhs: usize) -> usize
Unchecked integer addition. Computes self + rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_add(y)
is semantically equivalent to calling\nx.
checked_add
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_add
.
\n§Safety
\nThis results in undefined behavior when\nself + rhs > usize::MAX
or self + rhs < usize::MIN
,\ni.e. when checked_add
would return None
.
\n1.66.0 (const: 1.66.0) · sourcepub const fn checked_add_signed(self, rhs: isize) -> Option<usize>
Checked addition with a signed integer. Computes self + rhs
,\nreturning None
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_add_signed(2), Some(3));\nassert_eq!(1usize.checked_add_signed(-2), None);\nassert_eq!((usize::MAX - 2).checked_add_signed(3), None);
\nsourcepub const fn strict_add_signed(self, rhs: isize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict addition with a signed integer. Computes self + rhs
,\npanicking if overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_add_signed(2), 3);
\nThe following panic because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_add_signed(-2);
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add_signed(3);
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_sub(1), Some(0));\nassert_eq!(0usize.checked_sub(1), None);
\nsourcepub const fn strict_sub(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer subtraction. Computes self - rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_sub(1), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0usize.strict_sub(1);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_sub(self, rhs: usize) -> usize
Unchecked integer subtraction. Computes self - rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_sub(y)
is semantically equivalent to calling\nx.
checked_sub
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_sub
.
\nIf you find yourself writing code like this:
\n\nif foo >= bar {\n // SAFETY: just checked it will not overflow\n let diff = unsafe { foo.unchecked_sub(bar) };\n // ... use diff ...\n}
\nConsider changing it to
\n\nif let Some(diff) = foo.checked_sub(bar) {\n // ... use diff ...\n}
\nAs that does exactly the same thing – including telling the optimizer\nthat the subtraction cannot overflow – but avoids needing unsafe
.
\n§Safety
\nThis results in undefined behavior when\nself - rhs > usize::MAX
or self - rhs < usize::MIN
,\ni.e. when checked_sub
would return None
.
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_mul(1), Some(5));\nassert_eq!(usize::MAX.checked_mul(2), None);
\nsourcepub const fn strict_mul(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer multiplication. Computes self * rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(5usize.strict_mul(1), 5);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_mul(2);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_mul(self, rhs: usize) -> usize
Unchecked integer multiplication. Computes self * rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_mul(y)
is semantically equivalent to calling\nx.
checked_mul
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_mul
.
\n§Safety
\nThis results in undefined behavior when\nself * rhs > usize::MAX
or self * rhs < usize::MIN
,\ni.e. when checked_mul
would return None
.
\n1.0.0 (const: 1.52.0) · sourcepub const fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div(2), Some(64));\nassert_eq!(1usize.checked_div(0), None);
\nsourcepub const fn strict_div(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer division. Computes self / rhs
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div_euclid(2), Some(64));\nassert_eq!(1usize.checked_div_euclid(0), None);
\nsourcepub const fn strict_div_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean division. Computes self.div_euclid(rhs)
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div_euclid(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div_euclid(0);
\n1.7.0 (const: 1.52.0) · sourcepub const fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem(2), Some(1));\nassert_eq!(5usize.checked_rem(0), None);
\nsourcepub const fn strict_rem(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer remainder. Computes self % rhs
.\nStrict remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean modulo. Computes self.rem_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem_euclid(2), Some(1));\nassert_eq!(5usize.checked_rem_euclid(0), None);
\nsourcepub const fn strict_rem_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean modulo. Computes self.rem_euclid(rhs)
.\nStrict modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem_euclid(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem_euclid(0);
\n1.67.0 (const: 1.67.0) · sourcepub const fn ilog(self, base: usize) -> u32
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nThis method might not be optimized owing to implementation details;\nilog2
can produce results more efficiently for base 2, and ilog10
\ncan produce results more efficiently for base 10.
\n§Panics
\nThis function will panic if self
is zero, or if base
is less than 2.
\n§Examples
\nassert_eq!(5usize.ilog(5), 1);
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog(self, base: usize) -> Option<u32>
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nReturns None
if the number is zero, or if the base is not at least 2.
\nThis method might not be optimized owing to implementation details;\nchecked_ilog2
can produce results more efficiently for base 2, and\nchecked_ilog10
can produce results more efficiently for base 10.
\n§Examples
\nassert_eq!(5usize.checked_ilog(5), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog2(self) -> Option<u32>
Returns the base 2 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(2usize.checked_ilog2(), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog10(self) -> Option<u32>
Returns the base 10 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(10usize.checked_ilog10(), Some(1));
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_neg(self) -> Option<usize>
Checked negation. Computes -self
, returning None
unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0usize.checked_neg(), Some(0));\nassert_eq!(1usize.checked_neg(), None);
\nsourcepub const fn strict_neg(self) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict negation. Computes -self
, panicking unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0usize.strict_neg(), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_neg();
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x1usize.checked_shl(4), Some(0x10));\nassert_eq!(0x10usize.checked_shl(129), None);
\nsourcepub const fn strict_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift left. Computes self << rhs
, panicking if rhs
is larger\nthan or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x1usize.strict_shl(4), 0x10);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shl(129);
\nsourcepub const unsafe fn unchecked_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift left. Computes self << rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shl
would return None
.
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x10usize.checked_shr(4), Some(0x1));\nassert_eq!(0x10usize.checked_shr(129), None);
\nsourcepub const fn strict_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift right. Computes self >> rhs
, panicking rhs
is\nlarger than or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x10usize.strict_shr(4), 0x1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shr(129);
\nsourcepub const unsafe fn unchecked_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift right. Computes self >> rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shr
would return None
.
\n1.34.0 (const: 1.50.0) · sourcepub const fn checked_pow(self, exp: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_pow(5), Some(32));\nassert_eq!(usize::MAX.checked_pow(2), None);
\nsourcepub const fn strict_pow(self, exp: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict exponentiation. Computes self.pow(exp)
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(2usize.strict_pow(5), 32);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_pow(2);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at\nthe numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_add(1), 101);\nassert_eq!(usize::MAX.saturating_add(127), usize::MAX);
\n1.66.0 (const: 1.66.0) · sourcepub const fn saturating_add_signed(self, rhs: isize) -> usize
Saturating addition with a signed integer. Computes self + rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.saturating_add_signed(2), 3);\nassert_eq!(1usize.saturating_add_signed(-2), 0);\nassert_eq!((usize::MAX - 2).saturating_add_signed(4), usize::MAX);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating\nat the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_sub(27), 73);\nassert_eq!(13usize.saturating_sub(127), 0);
\n1.7.0 (const: 1.47.0) · sourcepub const fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.saturating_mul(10), 20);\nassert_eq!((usize::MAX).saturating_mul(10), usize::MAX);
\n1.58.0 (const: 1.58.0) · sourcepub const fn saturating_div(self, rhs: usize) -> usize
1.34.0 (const: 1.50.0) · sourcepub const fn saturating_pow(self, exp: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(4usize.saturating_pow(3), 64);\nassert_eq!(usize::MAX.saturating_pow(2), usize::MAX);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(200usize.wrapping_add(55), 255);\nassert_eq!(200usize.wrapping_add(usize::MAX), 199);
\n1.66.0 (const: 1.66.0) · sourcepub const fn wrapping_add_signed(self, rhs: isize) -> usize
Wrapping (modular) addition with a signed integer. Computes\nself + rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_add_signed(2), 3);\nassert_eq!(1usize.wrapping_add_signed(-2), usize::MAX);\nassert_eq!((usize::MAX - 2).wrapping_add_signed(4), 1);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_sub(100), 0);\nassert_eq!(100usize.wrapping_sub(usize::MAX), 101);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u8
is used here.
\n\nassert_eq!(10u8.wrapping_mul(12), 120);\nassert_eq!(25u8.wrapping_mul(12), 44);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div(10), 10);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div_euclid(10), 10);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
.\nWrapped remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem(10), 0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean modulo. Computes self.rem_euclid(rhs)
.\nWrapped modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem_euclid(10), 0);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type.
\nSince unsigned types do not have negative equivalents\nall applications of this function will wrap (except for -0
).\nFor values smaller than the corresponding signed type’s maximum\nthe result is the same as casting the corresponding signed value.\nAny larger values are equivalent to MAX + 1 - (val - MAX - 1)
where\nMAX
is the corresponding signed type’s maximum.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0_usize.wrapping_neg(), 0);\nassert_eq!(usize::MAX.wrapping_neg(), 1);\nassert_eq!(13_usize.wrapping_neg(), (!13) + 1);\nassert_eq!(42_usize.wrapping_neg(), !(42 - 1));
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-left; the\nRHS of a wrapping shift-left is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_left
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_shl(7), 128);\nassert_eq!(1usize.wrapping_shl(128), 1);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-right; the\nRHS of a wrapping shift-right is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_right
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.wrapping_shr(7), 1);\nassert_eq!(128usize.wrapping_shr(128), 128);
\n1.34.0 (const: 1.50.0) · sourcepub const fn wrapping_pow(self, exp: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.wrapping_pow(5), 243);\nassert_eq!(3u8.wrapping_pow(6), 217);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_add(self, rhs: usize) -> (usize, bool)
Calculates self
+ rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_add(2), (7, false));\nassert_eq!(usize::MAX.overflowing_add(1), (0, true));
\nsourcepub const fn carrying_add(self, rhs: usize, carry: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
+ rhs
+ carry
and returns a tuple containing\nthe sum and the output carry.
\nPerforms “ternary addition” of two integer operands and a carry-in\nbit, and returns an output integer and a carry-out bit. This allows\nchaining together multiple additions to create a wider addition, and\ncan be useful for bignum addition.
\nThis can be thought of as a 64-bit “full adder”, in the electronics sense.
\nIf the input carry is false, this method is equivalent to\noverflowing_add
, and the output carry is\nequal to the overflow flag. Note that although carry and overflow\nflags are similar for unsigned integers, they are different for\nsigned integers.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 3 MAX (a = 3 × 2^64 + 2^64 - 1)\n// + 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 9 6 (sum = 9 × 2^64 + 6)\n\nlet (a1, a0): (usize, usize) = (3, usize::MAX);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet carry0 = false;\n\nlet (sum0, carry1) = a0.carrying_add(b0, carry0);\nassert_eq!(carry1, true);\nlet (sum1, carry2) = a1.carrying_add(b1, carry1);\nassert_eq!(carry2, false);\n\nassert_eq!((sum1, sum0), (9, 6));
\n1.66.0 (const: 1.66.0) · sourcepub const fn overflowing_add_signed(self, rhs: isize) -> (usize, bool)
Calculates self
+ rhs
with a signed rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.overflowing_add_signed(2), (3, false));\nassert_eq!(1usize.overflowing_add_signed(-2), (usize::MAX, true));\nassert_eq!((usize::MAX - 2).overflowing_add_signed(4), (1, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_sub(self, rhs: usize) -> (usize, bool)
Calculates self
- rhs
\nReturns a tuple of the subtraction along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_sub(2), (3, false));\nassert_eq!(0usize.overflowing_sub(1), (usize::MAX, true));
\nsourcepub const fn borrowing_sub(self, rhs: usize, borrow: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
− rhs
− borrow
and returns a tuple\ncontaining the difference and the output borrow.
\nPerforms “ternary subtraction” by subtracting both an integer\noperand and a borrow-in bit from self
, and returns an output\ninteger and a borrow-out bit. This allows chaining together multiple\nsubtractions to create a wider subtraction, and can be useful for\nbignum subtraction.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 9 6 (a = 9 × 2^64 + 6)\n// - 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 3 MAX (diff = 3 × 2^64 + 2^64 - 1)\n\nlet (a1, a0): (usize, usize) = (9, 6);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet borrow0 = false;\n\nlet (diff0, borrow1) = a0.borrowing_sub(b0, borrow0);\nassert_eq!(borrow1, true);\nlet (diff1, borrow2) = a1.borrowing_sub(b1, borrow1);\nassert_eq!(borrow2, false);\n\nassert_eq!((diff1, diff0), (3, usize::MAX));
\n1.60.0 (const: 1.60.0) · sourcepub const fn abs_diff(self, other: usize) -> usize
Computes the absolute difference between self
and other
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.abs_diff(80), 20usize);\nassert_eq!(100usize.abs_diff(110), 10usize);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_mul(self, rhs: usize) -> (usize, bool)
Calculates the multiplication of self
and rhs
.
\nReturns a tuple of the multiplication along with a boolean\nindicating whether an arithmetic overflow would occur. If an\noverflow would have occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\nassert_eq!(5u32.overflowing_mul(2), (10, false));\nassert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_div(self, rhs: usize) -> (usize, bool)
Calculates the divisor when self
is divided by rhs
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div(2), (2, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.overflowing_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div_euclid(2), (2, false));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_rem(self, rhs: usize) -> (usize, bool)
Calculates the remainder when self
is divided by rhs
.
\nReturns a tuple of the remainder after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem(2), (1, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Calculates the remainder self.rem_euclid(rhs)
as if by Euclidean division.
\nReturns a tuple of the modulo after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this operation\nis exactly equal to self.overflowing_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem_euclid(2), (1, false));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_neg(self) -> (usize, bool)
Negates self in an overflowing fashion.
\nReturns !self + 1
using wrapping operations to return the value\nthat represents the negation of this unsigned value. Note that for\npositive unsigned values overflow always occurs, but negating 0 does\nnot overflow.
\n§Examples
\nBasic usage
\n\nassert_eq!(0usize.overflowing_neg(), (0, false));\nassert_eq!(2usize.overflowing_neg(), (-2i32 as usize, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shl(self, rhs: u32) -> (usize, bool)
Shifts self left by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x1usize.overflowing_shl(4), (0x10, false));\nassert_eq!(0x1usize.overflowing_shl(132), (0x10, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shr(self, rhs: u32) -> (usize, bool)
Shifts self right by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x10usize.overflowing_shr(4), (0x1, false));\nassert_eq!(0x10usize.overflowing_shr(132), (0x1, true));
\n1.34.0 (const: 1.50.0) · sourcepub const fn overflowing_pow(self, exp: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring.
\nReturns a tuple of the exponentiation along with a bool indicating\nwhether an overflow happened.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.overflowing_pow(5), (243, false));\nassert_eq!(3u8.overflowing_pow(6), (217, true));
\n1.0.0 (const: 1.50.0) · sourcepub const fn pow(self, exp: u32) -> usize
Raises self to the power of exp
, using exponentiation by squaring.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.pow(5), 32);
\nsourcepub const fn isqrt(self) -> usize
🔬This is a nightly-only experimental API. (isqrt
)
Returns the square root of the number, rounded down.
\n§Examples
\nBasic usage:
\n\n#![feature(isqrt)]\nassert_eq!(10usize.isqrt(), 3);
\n1.38.0 (const: 1.52.0) · sourcepub const fn div_euclid(self, rhs: usize) -> usize
1.38.0 (const: 1.52.0) · sourcepub const fn rem_euclid(self, rhs: usize) -> usize
Calculates the least remainder of self (mod rhs)
.
\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self % rhs
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(7usize.rem_euclid(4), 3); // or any other integer type
\nsourcepub const fn div_floor(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (int_roundings
)
Calculates the quotient of self
and rhs
, rounding the result towards negative infinity.
\nThis is the same as performing self / rhs
for all unsigned integers.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(int_roundings)]\nassert_eq!(7_usize.div_floor(4), 1);
\n1.73.0 (const: 1.73.0) · sourcepub const fn next_multiple_of(self, rhs: usize) -> usize
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Overflow behavior
\nOn overflow, this function will panic if overflow checks are enabled (default in debug\nmode) and wrap if overflow checks are disabled (default in release mode).
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.next_multiple_of(8), 16);\nassert_eq!(23_usize.next_multiple_of(8), 24);
\n1.73.0 (const: 1.73.0) · sourcepub const fn checked_next_multiple_of(self, rhs: usize) -> Option<usize>
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
. Returns None
if rhs
is zero or the\noperation would result in overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.checked_next_multiple_of(8), Some(16));\nassert_eq!(23_usize.checked_next_multiple_of(8), Some(24));\nassert_eq!(1_usize.checked_next_multiple_of(0), None);\nassert_eq!(usize::MAX.checked_next_multiple_of(2), None);
\n1.0.0 (const: 1.32.0) · sourcepub const fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.
\n§Examples
\nBasic usage:
\n\nassert!(16usize.is_power_of_two());\nassert!(!10usize.is_power_of_two());
\n1.0.0 (const: 1.50.0) · sourcepub const fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
.
\nWhen return value overflows (i.e., self > (1 << (N-1))
for type\nuN
), it panics in debug mode and the return value is wrapped to 0 in\nrelease mode (the only situation in which this method can return 0).
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.next_power_of_two(), 2);\nassert_eq!(3usize.next_power_of_two(), 4);\nassert_eq!(0usize.next_power_of_two(), 1);
\n1.0.0 (const: 1.50.0) · sourcepub const fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to self
. If\nthe next power of two is greater than the type’s maximum value,\nNone
is returned, otherwise the power of two is wrapped in Some
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_next_power_of_two(), Some(2));\nassert_eq!(3usize.checked_next_power_of_two(), Some(4));\nassert_eq!(usize::MAX.checked_next_power_of_two(), None);
\nsourcepub const fn wrapping_next_power_of_two(self) -> usize
🔬This is a nightly-only experimental API. (wrapping_next_power_of_two
)
Returns the smallest power of two greater than or equal to n
. If\nthe next power of two is greater than the type’s maximum value,\nthe return value is wrapped to 0
.
\n§Examples
\nBasic usage:
\n\n#![feature(wrapping_next_power_of_two)]\n\nassert_eq!(2usize.wrapping_next_power_of_two(), 2);\nassert_eq!(3usize.wrapping_next_power_of_two(), 4);\nassert_eq!(usize::MAX.wrapping_next_power_of_two(), 0);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_be_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nbig-endian (network) byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_be_bytes();\nassert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_le_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nlittle-endian byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_le_bytes();\nassert_eq!(bytes, [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_ne_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nnative byte order.
\nAs the target platform’s native endianness is used, portable code\nshould use to_be_bytes
or to_le_bytes
, as appropriate,\ninstead.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_ne_bytes();\nassert_eq!(\n bytes,\n if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n } else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n }\n);
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_be_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in big endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_be_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_be_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_le_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in little endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_le_bytes([0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_le_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_le_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_ne_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its memory representation\nas a byte array in native endianness.
\nAs the target platform’s native endianness is used, portable code\nlikely wants to use from_be_bytes
or from_le_bytes
, as\nappropriate instead.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_ne_bytes(if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n} else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n});\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_ne_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_ne_bytes(int_bytes.try_into().unwrap())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn min_value() -> usize
👎Deprecating in a future version: replaced by the MIN
associated constant on this type
New code should prefer to use\nusize::MIN
instead.
\nReturns the smallest value that can be represented by this integer type.
\n1.0.0 (const: 1.32.0) · sourcepub const fn max_value() -> usize
👎Deprecating in a future version: replaced by the MAX
associated constant on this type
New code should prefer to use\nusize::MAX
instead.
\nReturns the largest value that can be represented by this integer type.
\nsourcepub const fn widening_mul(self, rhs: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the complete product self * rhs
without the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nIf you also need to add a carry to the wide result, then you want\nSelf::carrying_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.widening_mul(2), (10, 0));\nassert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));
\nsourcepub const fn carrying_mul(self, rhs: usize, carry: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the “full multiplication” self * rhs + carry
\nwithout the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nPerforms “long multiplication” which takes in an extra amount to add, and may return an\nadditional amount of overflow. This allows for chaining together multiple\nmultiplications to create “big integers” which represent larger values.
\nIf you don’t need the carry
, then you can use Self::widening_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.carrying_mul(2, 0), (10, 0));\nassert_eq!(5u32.carrying_mul(2, 10), (20, 0));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));\nassert_eq!(usize::MAX.carrying_mul(usize::MAX, usize::MAX), (0, usize::MAX));
\nThis is the core operation needed for scalar multiplication when\nimplementing it for wider-than-native types.
\n\n#![feature(bigint_helper_methods)]\nfn scalar_mul_eq(little_endian_digits: &mut Vec<u16>, multiplicand: u16) {\n let mut carry = 0;\n for d in little_endian_digits.iter_mut() {\n (*d, carry) = d.carrying_mul(multiplicand, carry);\n }\n if carry != 0 {\n little_endian_digits.push(carry);\n }\n}\n\nlet mut v = vec![10, 20];\nscalar_mul_eq(&mut v, 3);\nassert_eq!(v, [30, 60]);\n\nassert_eq!(0x87654321_u64 * 0xFEED, 0x86D3D159E38D);\nlet mut v = vec![0x4321, 0x8765];\nscalar_mul_eq(&mut v, 0xFEED);\nassert_eq!(v, [0xE38D, 0xD159, 0x86D3]);
\nIf carry
is zero, this is similar to overflowing_mul
,\nexcept that it gives the value of the overflow instead of just whether one happened:
\n\n#![feature(bigint_helper_methods)]\nlet r = u8::carrying_mul(7, 13, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));\nlet r = u8::carrying_mul(13, 42, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(13, 42));
\nThe value of the first field in the returned tuple matches what you’d get\nby combining the wrapping_mul
and\nwrapping_add
methods:
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(\n 789_u16.carrying_mul(456, 123).0,\n 789_u16.wrapping_mul(456).wrapping_add(123),\n);
\nsourcepub const fn midpoint(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (num_midpoint
)
Calculates the middle point of self
and rhs
.
\nmidpoint(a, b)
is (a + b) >> 1
as if it were performed in a\nsufficiently-large signed integral type. This implies that the result is\nalways rounded towards negative infinity and that no overflow will ever occur.
\n§Examples
\n#![feature(num_midpoint)]\nassert_eq!(0usize.midpoint(4), 2);\nassert_eq!(1usize.midpoint(4), 2);
\n",0,"gosling::context::HandshakeHandle"],["source§impl usize
1.0.0 (const: unstable) · sourcepub fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer.
\nThe string is expected to be an optional +
sign\nfollowed by digits.\nLeading and trailing whitespace represent an error.\nDigits are a subset of these characters, depending on radix
:
\n\n0-9
\na-z
\nA-Z
\n
\n§Panics
\nThis function panics if radix
is not in the range from 2 to 36.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::from_str_radix(\"A\", 16), Ok(10));
\n",0,"gosling::context::HandshakeHandle"],["§impl AtLeast16 for usize
","AtLeast16","gosling::context::HandshakeHandle"],["§impl AtLeast32 for usize
","AtLeast32","gosling::context::HandshakeHandle"],["§impl AtLeast64 for usize
","AtLeast64","gosling::context::HandshakeHandle"],["§impl AtLeast8 for usize
","AtLeast8","gosling::context::HandshakeHandle"],["§impl AtMost128 for usize
","AtMost128","gosling::context::HandshakeHandle"],["§impl AtMost64 for usize
","AtMost64","gosling::context::HandshakeHandle"],["§impl BitOps for usize
","BitOps","gosling::context::HandshakeHandle"],["source§impl ConstParamTy for usize
","ConstParamTy","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Copy for usize
","Copy","gosling::context::HandshakeHandle"],["§impl DefaultIsZeroes for usize
","DefaultIsZeroes","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Eq for usize
","Eq","gosling::context::HandshakeHandle"],["§impl ExtendTarget<usize> for usize
","ExtendTarget","gosling::context::HandshakeHandle"],["source§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["source§impl Integer for usize
","Integer","gosling::context::HandshakeHandle"],["§impl Is64 for usize
","Is64","gosling::context::HandshakeHandle"],["§impl NotAutoValue for usize
","NotAutoValue","gosling::context::HandshakeHandle"],["§impl NumericOps for usize
","NumericOps","gosling::context::HandshakeHandle"],["source§impl SimdCast for usize
","SimdCast","gosling::context::HandshakeHandle"],["source§impl StructuralPartialEq for usize
","StructuralPartialEq","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u16> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u8> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<usize> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["source§impl TrustedStep for usize
","TrustedStep","gosling::context::HandshakeHandle"],["§impl Uint for usize
","Uint","gosling::context::HandshakeHandle"],["source§impl Unsigned for usize
","Unsigned","gosling::context::HandshakeHandle"],["source§impl Weight for usize
","Weight","gosling::context::HandshakeHandle"],["source§impl ZeroablePrimitive for usize
","ZeroablePrimitive","gosling::context::HandshakeHandle"]],
-"tor_interface":[["","Accumulate","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Add<&usize>","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","tor_interface::tor_provider::CircuitToken"],["","AsAny","tor_interface::tor_provider::CircuitToken"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["","Binary","tor_interface::tor_provider::CircuitToken"],["","BitAnd<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitAnd","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","tor_interface::tor_provider::CircuitToken"],["","BitOr<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitOr","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","tor_interface::tor_provider::CircuitToken"],["","BitRegister","tor_interface::tor_provider::CircuitToken"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","tor_interface::tor_provider::CircuitToken"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","tor_interface::tor_provider::CircuitToken"],["","BitXor<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitXor","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","tor_interface::tor_provider::CircuitToken"],["","Bits","tor_interface::tor_provider::CircuitToken"],["","Bounded","tor_interface::tor_provider::CircuitToken"],["","CastSigned","tor_interface::tor_provider::CircuitToken"],["","CastUnsigned","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedAdd for usize
","CheckedAdd","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedDiv for usize
","CheckedDiv","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedMul for usize
","CheckedMul","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedNeg for usize
","CheckedNeg","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedRem for usize
","CheckedRem","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShl for usize
","CheckedShl","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShr for usize
","CheckedShr","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedSub for usize
","CheckedSub","tor_interface::tor_provider::CircuitToken"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","tor_interface::tor_provider::CircuitToken"],["","Clone","tor_interface::tor_provider::CircuitToken"],["","ConstOne","tor_interface::tor_provider::CircuitToken"],["","ConstZero","tor_interface::tor_provider::CircuitToken"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","tor_interface::tor_provider::CircuitToken"],["","Debug","tor_interface::tor_provider::CircuitToken"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","tor_interface::tor_provider::CircuitToken"],["","Default","tor_interface::tor_provider::CircuitToken"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","tor_interface::tor_provider::CircuitToken"],["","Display","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Div<&usize>","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","tor_interface::tor_provider::CircuitToken"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","tor_interface::tor_provider::CircuitToken"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","tor_interface::tor_provider::CircuitToken"],["","FmtConst","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","tor_interface::tor_provider::CircuitToken"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","tor_interface::tor_provider::CircuitToken"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","tor_interface::tor_provider::CircuitToken"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","tor_interface::tor_provider::CircuitToken"],["","FromStr","tor_interface::tor_provider::CircuitToken"],["","FromZeroes","tor_interface::tor_provider::CircuitToken"],["","Fundamental","tor_interface::tor_provider::CircuitToken"],["","Hash","tor_interface::tor_provider::CircuitToken"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","tor_interface::tor_provider::CircuitToken"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","tor_interface::tor_provider::CircuitToken"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","tor_interface::tor_provider::CircuitToken"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","tor_interface::tor_provider::CircuitToken"],["","LowerExp","tor_interface::tor_provider::CircuitToken"],["","LowerHex","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Mul<&usize>","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","MulAdd","tor_interface::tor_provider::CircuitToken"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","tor_interface::tor_provider::CircuitToken"],["","Not","tor_interface::tor_provider::CircuitToken"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","tor_interface::tor_provider::CircuitToken"],["","NumCast","tor_interface::tor_provider::CircuitToken"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","tor_interface::tor_provider::CircuitToken"],["","Octal","tor_interface::tor_provider::CircuitToken"],["","One","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Ord for usize
","Ord","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingAdd for usize
","OverflowingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingMul for usize
","OverflowingMul","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingSub for usize
","OverflowingSub","tor_interface::tor_provider::CircuitToken"],["","ParseHex","tor_interface::tor_provider::CircuitToken"],["source§impl PartialEq<Value> for usize
","PartialEq","tor_interface::tor_provider::CircuitToken"],["","PartialEq","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","tor_interface::tor_provider::CircuitToken"],["","PhfBorrow","tor_interface::tor_provider::CircuitToken"],["","PhfHash","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u16>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u32>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u8>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","tor_interface::tor_provider::CircuitToken"],["","Product<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Product","tor_interface::tor_provider::CircuitToken"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Rem<&usize>","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","tor_interface::tor_provider::CircuitToken"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["source§impl Roots for usize
","Roots","tor_interface::tor_provider::CircuitToken"],["","RowIndex","tor_interface::tor_provider::CircuitToken"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","tor_interface::tor_provider::CircuitToken"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","tor_interface::tor_provider::CircuitToken"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","tor_interface::tor_provider::CircuitToken"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","tor_interface::tor_provider::CircuitToken"],["","Shl<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["","Shr<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["
fn min(self, other: Self) -> Selfwhere
diff --git a/crates/type.impl/std/primitive.usize.js b/crates/type.impl/std/primitive.usize.js
index da014e4e..ef01c053 100644
--- a/crates/type.impl/std/primitive.usize.js
+++ b/crates/type.impl/std/primitive.usize.js
@@ -1,4 +1,4 @@
(function() {var type_impls = {
-"gosling":[["","Accumulate","gosling::context::HandshakeHandle"],["","Add<&'a BigInt>","gosling::context::HandshakeHandle"],["","Add<&'a BigUint>","gosling::context::HandshakeHandle"],["","Add<&usize>","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["","Add","gosling::context::HandshakeHandle"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","gosling::context::HandshakeHandle"],["","AsAny","gosling::context::HandshakeHandle"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","gosling::context::HandshakeHandle"],["","Binary","gosling::context::HandshakeHandle"],["","BitAnd<&usize>","gosling::context::HandshakeHandle"],["","BitAnd","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","gosling::context::HandshakeHandle"],["","BitOr<&usize>","gosling::context::HandshakeHandle"],["","BitOr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","gosling::context::HandshakeHandle"],["","BitRegister","gosling::context::HandshakeHandle"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","gosling::context::HandshakeHandle"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","gosling::context::HandshakeHandle"],["","BitXor<&usize>","gosling::context::HandshakeHandle"],["","BitXor","gosling::context::HandshakeHandle"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","gosling::context::HandshakeHandle"],["","Bits","gosling::context::HandshakeHandle"],["","Bounded","gosling::context::HandshakeHandle"],["","CastSigned","gosling::context::HandshakeHandle"],["","CastUnsigned","gosling::context::HandshakeHandle"],["source§impl CheckedAdd for usize
","CheckedAdd","gosling::context::HandshakeHandle"],["source§impl CheckedDiv for usize
","CheckedDiv","gosling::context::HandshakeHandle"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","gosling::context::HandshakeHandle"],["source§impl CheckedMul for usize
","CheckedMul","gosling::context::HandshakeHandle"],["source§impl CheckedNeg for usize
","CheckedNeg","gosling::context::HandshakeHandle"],["source§impl CheckedRem for usize
","CheckedRem","gosling::context::HandshakeHandle"],["source§impl CheckedShl for usize
","CheckedShl","gosling::context::HandshakeHandle"],["source§impl CheckedShr for usize
","CheckedShr","gosling::context::HandshakeHandle"],["source§impl CheckedSub for usize
","CheckedSub","gosling::context::HandshakeHandle"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","gosling::context::HandshakeHandle"],["","Clone","gosling::context::HandshakeHandle"],["","ConstOne","gosling::context::HandshakeHandle"],["","ConstZero","gosling::context::HandshakeHandle"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","gosling::context::HandshakeHandle"],["","Debug","gosling::context::HandshakeHandle"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","gosling::context::HandshakeHandle"],["","Default","gosling::context::HandshakeHandle"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","gosling::context::HandshakeHandle"],["","Display","gosling::context::HandshakeHandle"],["","Div<&'a BigInt>","gosling::context::HandshakeHandle"],["","Div<&'a BigUint>","gosling::context::HandshakeHandle"],["","Div<&usize>","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div","gosling::context::HandshakeHandle"],["","Div>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","gosling::context::HandshakeHandle"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","gosling::context::HandshakeHandle"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","gosling::context::HandshakeHandle"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","gosling::context::HandshakeHandle"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","gosling::context::HandshakeHandle"],["","FmtConst","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From>","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["","From","gosling::context::HandshakeHandle"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","gosling::context::HandshakeHandle"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","gosling::context::HandshakeHandle"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","gosling::context::HandshakeHandle"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","gosling::context::HandshakeHandle"],["","FromStr","gosling::context::HandshakeHandle"],["","FromZeroes","gosling::context::HandshakeHandle"],["","Fundamental","gosling::context::HandshakeHandle"],["","Hash","gosling::context::HandshakeHandle"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","gosling::context::HandshakeHandle"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","gosling::context::HandshakeHandle"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","gosling::context::HandshakeHandle"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","gosling::context::HandshakeHandle"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","gosling::context::HandshakeHandle"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","gosling::context::HandshakeHandle"],["","LowerExp","gosling::context::HandshakeHandle"],["","LowerHex","gosling::context::HandshakeHandle"],["","Mul<&'a BigInt>","gosling::context::HandshakeHandle"],["","Mul<&'a BigUint>","gosling::context::HandshakeHandle"],["","Mul<&usize>","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","Mul","gosling::context::HandshakeHandle"],["","MulAdd","gosling::context::HandshakeHandle"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","gosling::context::HandshakeHandle"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","gosling::context::HandshakeHandle"],["","Not","gosling::context::HandshakeHandle"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","gosling::context::HandshakeHandle"],["","NumCast","gosling::context::HandshakeHandle"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","gosling::context::HandshakeHandle"],["","Octal","gosling::context::HandshakeHandle"],["","One","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Ord for usize
","Ord","gosling::context::HandshakeHandle"],["source§impl OverflowingAdd for usize
","OverflowingAdd","gosling::context::HandshakeHandle"],["source§impl OverflowingMul for usize
","OverflowingMul","gosling::context::HandshakeHandle"],["source§impl OverflowingSub for usize
","OverflowingSub","gosling::context::HandshakeHandle"],["","ParseHex","gosling::context::HandshakeHandle"],["source§impl PartialEq<Value> for usize
","PartialEq","gosling::context::HandshakeHandle"],["","PartialEq","gosling::context::HandshakeHandle"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","gosling::context::HandshakeHandle"],["","PhfBorrow","gosling::context::HandshakeHandle"],["","PhfHash","gosling::context::HandshakeHandle"],["","Pow<&'a u16>","gosling::context::HandshakeHandle"],["","Pow<&'a u32>","gosling::context::HandshakeHandle"],["","Pow<&'a u8>","gosling::context::HandshakeHandle"],["","Pow<&'a usize>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow>","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["","Pow","gosling::context::HandshakeHandle"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","gosling::context::HandshakeHandle"],["","Product<&'a usize>","gosling::context::HandshakeHandle"],["","Product","gosling::context::HandshakeHandle"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","gosling::context::HandshakeHandle"],["","Rem<&'a BigInt>","gosling::context::HandshakeHandle"],["","Rem<&'a BigUint>","gosling::context::HandshakeHandle"],["","Rem<&usize>","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem","gosling::context::HandshakeHandle"],["","Rem>","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","gosling::context::HandshakeHandle"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","gosling::context::HandshakeHandle"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","gosling::context::HandshakeHandle"],["source§impl Roots for usize
","Roots","gosling::context::HandshakeHandle"],["","RowIndex","gosling::context::HandshakeHandle"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","gosling::context::HandshakeHandle"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","gosling::context::HandshakeHandle"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","gosling::context::HandshakeHandle"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","gosling::context::HandshakeHandle"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","gosling::context::HandshakeHandle"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","gosling::context::HandshakeHandle"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","gosling::context::HandshakeHandle"],["","Shl<&i128>","gosling::context::HandshakeHandle"],["","Shl<&i16>","gosling::context::HandshakeHandle"],["","Shl<&i32>","gosling::context::HandshakeHandle"],["","Shl<&i64>","gosling::context::HandshakeHandle"],["","Shl<&i8>","gosling::context::HandshakeHandle"],["","Shl<&isize>","gosling::context::HandshakeHandle"],["","Shl<&u128>","gosling::context::HandshakeHandle"],["","Shl<&u16>","gosling::context::HandshakeHandle"],["","Shl<&u32>","gosling::context::HandshakeHandle"],["","Shl<&u64>","gosling::context::HandshakeHandle"],["","Shl<&u8>","gosling::context::HandshakeHandle"],["","Shl<&usize>","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["","Shl","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","gosling::context::HandshakeHandle"],["","Shr<&i128>","gosling::context::HandshakeHandle"],["","Shr<&i16>","gosling::context::HandshakeHandle"],["","Shr<&i32>","gosling::context::HandshakeHandle"],["","Shr<&i64>","gosling::context::HandshakeHandle"],["","Shr<&i8>","gosling::context::HandshakeHandle"],["","Shr<&isize>","gosling::context::HandshakeHandle"],["","Shr<&u128>","gosling::context::HandshakeHandle"],["","Shr<&u16>","gosling::context::HandshakeHandle"],["","Shr<&u32>","gosling::context::HandshakeHandle"],["","Shr<&u64>","gosling::context::HandshakeHandle"],["","Shr<&u8>","gosling::context::HandshakeHandle"],["","Shr<&usize>","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["","Shr","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i128> for usize
source§fn shr_assign(&mut self, other: &i128)
Performs the >>=
operation. Read more","ShrAssign<&i128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i16> for usize
source§fn shr_assign(&mut self, other: &i16)
Performs the >>=
operation. Read more","ShrAssign<&i16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i32> for usize
source§fn shr_assign(&mut self, other: &i32)
Performs the >>=
operation. Read more","ShrAssign<&i32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i64> for usize
source§fn shr_assign(&mut self, other: &i64)
Performs the >>=
operation. Read more","ShrAssign<&i64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&i8> for usize
source§fn shr_assign(&mut self, other: &i8)
Performs the >>=
operation. Read more","ShrAssign<&i8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&isize> for usize
source§fn shr_assign(&mut self, other: &isize)
Performs the >>=
operation. Read more","ShrAssign<&isize>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u128> for usize
source§fn shr_assign(&mut self, other: &u128)
Performs the >>=
operation. Read more","ShrAssign<&u128>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u16> for usize
source§fn shr_assign(&mut self, other: &u16)
Performs the >>=
operation. Read more","ShrAssign<&u16>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u32> for usize
source§fn shr_assign(&mut self, other: &u32)
Performs the >>=
operation. Read more","ShrAssign<&u32>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u64> for usize
source§fn shr_assign(&mut self, other: &u64)
Performs the >>=
operation. Read more","ShrAssign<&u64>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&u8> for usize
source§fn shr_assign(&mut self, other: &u8)
Performs the >>=
operation. Read more","ShrAssign<&u8>","gosling::context::HandshakeHandle"],["1.22.0 · source§impl ShrAssign<&usize> for usize
source§fn shr_assign(&mut self, other: &usize)
Performs the >>=
operation. Read more","ShrAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i128> for usize
source§fn shr_assign(&mut self, other: i128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i16> for usize
source§fn shr_assign(&mut self, other: i16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i32> for usize
source§fn shr_assign(&mut self, other: i32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i64> for usize
source§fn shr_assign(&mut self, other: i64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<i8> for usize
source§fn shr_assign(&mut self, other: i8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<isize> for usize
source§fn shr_assign(&mut self, other: isize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u128> for usize
source§fn shr_assign(&mut self, other: u128)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u16> for usize
source§fn shr_assign(&mut self, other: u16)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u32> for usize
source§fn shr_assign(&mut self, other: u32)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u64> for usize
source§fn shr_assign(&mut self, other: u64)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign<u8> for usize
source§fn shr_assign(&mut self, other: u8)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["1.8.0 · source§impl ShrAssign for usize
source§fn shr_assign(&mut self, other: usize)
Performs the >>=
operation. Read more","ShrAssign","gosling::context::HandshakeHandle"],["source§impl SimdElement for usize
","SimdElement","gosling::context::HandshakeHandle"],["1.15.0 (const: unstable) · source§impl<T> SliceIndex<[T]> for usize
The methods index
and index_mut
panic if the index is out of bounds.
\nsource§fn get(self, slice: &[T]) -> Option<&T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a shared reference to the output at this location, if in\nbounds.source§fn get_mut(self, slice: &mut [T]) -> Option<&mut T>
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable reference to the output at this location, if in\nbounds.source§unsafe fn get_unchecked(self, slice: *const [T]) -> *const T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.source§unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut T
🔬This is a nightly-only experimental API. (slice_index_methods
)Returns a mutable pointer to the output at this location, without\nperforming any bounds checking.\nCalling this method with an out-of-bounds index or a dangling slice
pointer\nis undefined behavior even if the resulting pointer is not used.","SliceIndex<[T]>","gosling::context::HandshakeHandle"],["§impl SmartDisplay for usize
§fn metadata(&self, f: FormatterOptions) -> Metadata<'_, usize>
Compute any information needed to format the value. This must, at a minimum, determine the\nwidth of the value before any padding is added by the formatter. Read more§fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Format the value using the given formatter. This is the same as Display::fmt
. Read more§fn fmt_with_metadata(\n &self,\n f: &mut Formatter<'_>,\n _metadata: Metadata<'_, Self>,\n) -> Result<(), Error>
Format the value using the given formatter and metadata. The formatted output should have\nthe width indicated by the metadata. This is before any padding is added by the\nformatter. Read more","SmartDisplay","gosling::context::HandshakeHandle"],["source§impl Step for usize
source§fn forward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn backward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn forward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§unsafe fn backward_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (step_trait
)source§fn steps_between(start: &usize, end: &usize) -> Option<usize>
🔬This is a nightly-only experimental API. (step_trait
)","Step","gosling::context::HandshakeHandle"],["","Sub<&'a BigInt>","gosling::context::HandshakeHandle"],["","Sub<&'a BigUint>","gosling::context::HandshakeHandle"],["","Sub<&usize>","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["","Sub","gosling::context::HandshakeHandle"],["1.22.0 · source§impl SubAssign<&usize> for usize
source§fn sub_assign(&mut self, other: &usize)
Performs the -=
operation. Read more","SubAssign<&usize>","gosling::context::HandshakeHandle"],["1.8.0 · source§impl SubAssign for usize
source§fn sub_assign(&mut self, other: usize)
Performs the -=
operation. Read more","SubAssign","gosling::context::HandshakeHandle"],["","Sum<&'a usize>","gosling::context::HandshakeHandle"],["","Sum","gosling::context::HandshakeHandle"],["","ToBigInt","gosling::context::HandshakeHandle"],["source§impl ToBigUint for usize
source§fn to_biguint(&self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","ToBigUint","gosling::context::HandshakeHandle"],["source§impl ToBytes for usize
§type Bytes = [u8; 8]
source§fn to_be_bytes(&self) -> <usize as ToBytes>::Bytes
Return the memory representation of this number as a byte array in big-endian byte order. Read more","ToBytes","gosling::context::HandshakeHandle"],["source§impl ToPrimitive for usize
source§fn to_isize(&self) -> Option<isize>
Converts the value of self
to an isize
. If the value cannot be\nrepresented by an isize
, then None
is returned.source§fn to_i8(&self) -> Option<i8>
Converts the value of self
to an i8
. If the value cannot be\nrepresented by an i8
, then None
is returned.source§fn to_i16(&self) -> Option<i16>
Converts the value of self
to an i16
. If the value cannot be\nrepresented by an i16
, then None
is returned.source§fn to_i32(&self) -> Option<i32>
Converts the value of self
to an i32
. If the value cannot be\nrepresented by an i32
, then None
is returned.source§fn to_i64(&self) -> Option<i64>
Converts the value of self
to an i64
. If the value cannot be\nrepresented by an i64
, then None
is returned.source§fn to_i128(&self) -> Option<i128>
Converts the value of self
to an i128
. If the value cannot be\nrepresented by an i128
(i64
under the default implementation), then\nNone
is returned. Read moresource§fn to_usize(&self) -> Option<usize>
Converts the value of self
to a usize
. If the value cannot be\nrepresented by a usize
, then None
is returned.source§fn to_u8(&self) -> Option<u8>
Converts the value of self
to a u8
. If the value cannot be\nrepresented by a u8
, then None
is returned.source§fn to_u16(&self) -> Option<u16>
Converts the value of self
to a u16
. If the value cannot be\nrepresented by a u16
, then None
is returned.source§fn to_u32(&self) -> Option<u32>
Converts the value of self
to a u32
. If the value cannot be\nrepresented by a u32
, then None
is returned.source§fn to_u64(&self) -> Option<u64>
Converts the value of self
to a u64
. If the value cannot be\nrepresented by a u64
, then None
is returned.source§fn to_u128(&self) -> Option<u128>
Converts the value of self
to a u128
. If the value cannot be\nrepresented by a u128
(u64
under the default implementation), then\nNone
is returned. Read more","ToPrimitive","gosling::context::HandshakeHandle"],["","ToSql","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","ToUsize","gosling::context::HandshakeHandle"],["","TryFrom>","gosling::context::HandshakeHandle"],["","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i128> for usize
source§fn try_from(u: i128) -> Result<usize, <usize as TryFrom<i128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i16> for usize
source§fn try_from(u: i16) -> Result<usize, <usize as TryFrom<i16>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i32> for usize
source§fn try_from(u: i32) -> Result<usize, <usize as TryFrom<i32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i64> for usize
source§fn try_from(u: i64) -> Result<usize, <usize as TryFrom<i64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<i8> for usize
source§fn try_from(u: i8) -> Result<usize, <usize as TryFrom<i8>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<isize> for usize
source§fn try_from(u: isize) -> Result<usize, <usize as TryFrom<isize>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u128> for usize
source§fn try_from(u: u128) -> Result<usize, <usize as TryFrom<u128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u32> for usize
source§fn try_from(value: u32) -> Result<usize, <usize as TryFrom<u32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["1.34.0 · source§impl TryFrom<u64> for usize
source§fn try_from(value: u64) -> Result<usize, <usize as TryFrom<u64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
The type returned in the event of a conversion error.","TryFrom","gosling::context::HandshakeHandle"],["§impl Unsigned for usize
§fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.§fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
. Read more§fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to n
. If the\nnext power of two is greater than the type’s maximum value, None
is\nreturned, otherwise the power of two is wrapped in Some
.","Unsigned","gosling::context::HandshakeHandle"],["","UpperExp","gosling::context::HandshakeHandle"],["","UpperHex","gosling::context::HandshakeHandle"],["","Value","gosling::context::HandshakeHandle"],["source§impl WrappingAdd for usize
source§fn wrapping_add(&self, v: &usize) -> usize
Wrapping (modular) addition. Computes self + other
, wrapping around at the boundary of\nthe type.","WrappingAdd","gosling::context::HandshakeHandle"],["source§impl WrappingMul for usize
source§fn wrapping_mul(&self, v: &usize) -> usize
Wrapping (modular) multiplication. Computes self * other
, wrapping around at the boundary\nof the type.","WrappingMul","gosling::context::HandshakeHandle"],["source§impl WrappingNeg for usize
source§fn wrapping_neg(&self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type. Read more","WrappingNeg","gosling::context::HandshakeHandle"],["source§impl WrappingShl for usize
","WrappingShl","gosling::context::HandshakeHandle"],["source§impl WrappingShr for usize
","WrappingShr","gosling::context::HandshakeHandle"],["source§impl WrappingSub for usize
source§fn wrapping_sub(&self, v: &usize) -> usize
Wrapping (modular) subtraction. Computes self - other
, wrapping around at the boundary\nof the type.","WrappingSub","gosling::context::HandshakeHandle"],["","WriteHex","gosling::context::HandshakeHandle"],["§impl Writeable for usize
§fn write_to<W>(&self, sink: &mut W) -> Result<(), Error>
Writes a string to the given sink. Errors from the sink are bubbled up.\nThe default implementation delegates to write_to_parts
, and discards any\nPart
annotations.§fn writeable_length_hint(&self) -> LengthHint
Returns a hint for the number of UTF-8 bytes that will be written to the sink. Read more§fn write_to_parts<S>(&self, sink: &mut S) -> Result<(), Error>where\n S: PartsWrite + ?Sized,
Write bytes and Part
annotations to the given sink. Errors from the\nsink are bubbled up. The default implementation delegates to write_to
,\nand doesn’t produce any Part
annotations.§fn write_to_string(&self) -> Cow<'_, str>
Creates a new String
with the data from this Writeable
. Like ToString
,\nbut smaller and faster. Read more§fn writeable_cmp_bytes(&self, other: &[u8]) -> Ordering
Compares the contents of this Writeable
to the given bytes\nwithout allocating a String to hold the Writeable
contents. Read more","Writeable","gosling::context::HandshakeHandle"],["§impl<'a> Yokeable<'a> for usize
§fn transform_owned(self) -> <usize as Yokeable<'a>>::Output
§unsafe fn make(this: <usize as Yokeable<'a>>::Output) -> usize
This method can be used to cast away Self<'a>
’s lifetime. Read more§fn transform_mut<F>(&'a mut self, f: F)
This method must cast self
between &'a mut Self<'static>
and &'a mut Self<'a>
,\nand pass it to f
. Read more","Yokeable<'a>","gosling::context::HandshakeHandle"],["","Zero","gosling::context::HandshakeHandle"],["","ZeroFrom<'a, usize>","gosling::context::HandshakeHandle"],["§impl<'a> ZeroMapKV<'a> for usize
","ZeroMapKV<'a>","gosling::context::HandshakeHandle"],["source§impl usize
1.43.0 · sourcepub const MIN: usize = 0usize
The smallest value that can be represented by this integer type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MIN, 0);
\n1.43.0 · sourcepub const MAX: usize = 18_446_744_073_709_551_615usize
The largest value that can be represented by this integer type\n(264 − 1 on 64-bit targets).
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX, 18446744073709551615);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b01001100usize;\n\nassert_eq!(n.count_ones(), 3);
\n1.0.0 (const: 1.32.0) · sourcepub const fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX.count_zeros(), 0);
\n1.0.0 (const: 1.32.0) · sourcepub const fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of self
.
\nDepending on what you’re doing with the value, you might also be interested in the\nilog2
function which returns a consistent number, even if the type widens.
\n§Examples
\nBasic usage:
\n\nlet n = usize::MAX >> 2;\n\nassert_eq!(n.leading_zeros(), 2);
\n1.0.0 (const: 1.32.0) · sourcepub const fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b0101000usize;\n\nassert_eq!(n.trailing_zeros(), 3);
\n1.46.0 (const: 1.46.0) · sourcepub const fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of self
.
\n§Examples
\nBasic usage:
\n\nlet n = !(usize::MAX >> 2);\n\nassert_eq!(n.leading_ones(), 2);
\n1.46.0 (const: 1.46.0) · sourcepub const fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
.
\n§Examples
\nBasic usage:
\n\nlet n = 0b1010111usize;\n\nassert_eq!(n.trailing_ones(), 3);
\nsourcepub const fn cast_signed(self) -> isize
🔬This is a nightly-only experimental API. (integer_sign_cast
)
Returns the bit pattern of self
reinterpreted as a signed integer of the same size.
\nThis produces the same result as an as
cast, but ensures that the bit-width remains\nthe same.
\n§Examples
\nBasic usage:
\n\n#![feature(integer_sign_cast)]\n\nlet n = usize::MAX;\n\nassert_eq!(n.cast_signed(), -1isize);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
,\nwrapping the truncated bits to the end of the resulting integer.
\nPlease note this isn’t the same operation as the <<
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0xaa00000000006e1usize;\nlet m = 0x6e10aa;\n\nassert_eq!(n.rotate_left(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
,\nwrapping the truncated bits to the beginning of the resulting\ninteger.
\nPlease note this isn’t the same operation as the >>
shifting operator!
\n§Examples
\nBasic usage:
\n\nlet n = 0x6e10aausize;\nlet m = 0xaa00000000006e1;\n\nassert_eq!(n.rotate_right(12), m);
\n1.0.0 (const: 1.32.0) · sourcepub const fn swap_bytes(self) -> usize
Reverses the byte order of the integer.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.swap_bytes();\n\nassert_eq!(m, 0x5634129078563412);
\n1.37.0 (const: 1.37.0) · sourcepub const fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit,\nsecond least-significant bit becomes second most-significant bit, etc.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.reverse_bits();\n\nassert_eq!(m, 0x6a2c48091e6a2c48);\nassert_eq!(0, 0usize.reverse_bits());
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_be(x: usize) -> usize
Converts an integer from big endian to the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(usize::from_be(n), n)\n} else {\n assert_eq!(usize::from_be(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn from_le(x: usize) -> usize
Converts an integer from little endian to the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(usize::from_le(n), n)\n} else {\n assert_eq!(usize::from_le(n), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_be(self) -> usize
Converts self
to big endian from the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(n.to_be(), n)\n} else {\n assert_eq!(n.to_be(), n.swap_bytes())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn to_le(self) -> usize
Converts self
to little endian from the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(n.to_le(), n)\n} else {\n assert_eq!(n.to_le(), n.swap_bytes())\n}
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
\nif overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!((usize::MAX - 2).checked_add(1), Some(usize::MAX - 1));\nassert_eq!((usize::MAX - 2).checked_add(3), None);
\nsourcepub const fn strict_add(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer addition. Computes self + rhs
, panicking\nif overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!((usize::MAX - 2).strict_add(1), usize::MAX - 1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add(3);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_add(self, rhs: usize) -> usize
Unchecked integer addition. Computes self + rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_add(y)
is semantically equivalent to calling\nx.
checked_add
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_add
.
\n§Safety
\nThis results in undefined behavior when\nself + rhs > usize::MAX
or self + rhs < usize::MIN
,\ni.e. when checked_add
would return None
.
\n1.66.0 (const: 1.66.0) · sourcepub const fn checked_add_signed(self, rhs: isize) -> Option<usize>
Checked addition with a signed integer. Computes self + rhs
,\nreturning None
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_add_signed(2), Some(3));\nassert_eq!(1usize.checked_add_signed(-2), None);\nassert_eq!((usize::MAX - 2).checked_add_signed(3), None);
\nsourcepub const fn strict_add_signed(self, rhs: isize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict addition with a signed integer. Computes self + rhs
,\npanicking if overflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_add_signed(2), 3);
\nThe following panic because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_add_signed(-2);
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add_signed(3);
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_sub(1), Some(0));\nassert_eq!(0usize.checked_sub(1), None);
\nsourcepub const fn strict_sub(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer subtraction. Computes self - rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_sub(1), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0usize.strict_sub(1);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_sub(self, rhs: usize) -> usize
Unchecked integer subtraction. Computes self - rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_sub(y)
is semantically equivalent to calling\nx.
checked_sub
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_sub
.
\nIf you find yourself writing code like this:
\n\nif foo >= bar {\n // SAFETY: just checked it will not overflow\n let diff = unsafe { foo.unchecked_sub(bar) };\n // ... use diff ...\n}
\nConsider changing it to
\n\nif let Some(diff) = foo.checked_sub(bar) {\n // ... use diff ...\n}
\nAs that does exactly the same thing – including telling the optimizer\nthat the subtraction cannot overflow – but avoids needing unsafe
.
\n§Safety
\nThis results in undefined behavior when\nself - rhs > usize::MAX
or self - rhs < usize::MIN
,\ni.e. when checked_sub
would return None
.
\n1.0.0 (const: 1.47.0) · sourcepub const fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning\nNone
if overflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_mul(1), Some(5));\nassert_eq!(usize::MAX.checked_mul(2), None);
\nsourcepub const fn strict_mul(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer multiplication. Computes self * rhs
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(5usize.strict_mul(1), 5);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_mul(2);
\n1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_mul(self, rhs: usize) -> usize
Unchecked integer multiplication. Computes self * rhs
, assuming overflow\ncannot occur.
\nCalling x.unchecked_mul(y)
is semantically equivalent to calling\nx.
checked_mul
(y).
unwrap_unchecked
()
.
\nIf you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_mul
.
\n§Safety
\nThis results in undefined behavior when\nself * rhs > usize::MAX
or self * rhs < usize::MIN
,\ni.e. when checked_mul
would return None
.
\n1.0.0 (const: 1.52.0) · sourcepub const fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div(2), Some(64));\nassert_eq!(1usize.checked_div(0), None);
\nsourcepub const fn strict_div(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer division. Computes self / rhs
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div_euclid(2), Some(64));\nassert_eq!(1usize.checked_div_euclid(0), None);
\nsourcepub const fn strict_div_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean division. Computes self.div_euclid(rhs)
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div_euclid(10), 10);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div_euclid(0);
\n1.7.0 (const: 1.52.0) · sourcepub const fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem(2), Some(1));\nassert_eq!(5usize.checked_rem(0), None);
\nsourcepub const fn strict_rem(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict integer remainder. Computes self % rhs
.\nStrict remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem(0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean modulo. Computes self.rem_euclid(rhs)
, returning None
\nif rhs == 0
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem_euclid(2), Some(1));\nassert_eq!(5usize.checked_rem_euclid(0), None);
\nsourcepub const fn strict_rem_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict Euclidean modulo. Computes self.rem_euclid(rhs)
.\nStrict modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem_euclid(10), 0);
\nThe following panics because of division by zero:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem_euclid(0);
\n1.67.0 (const: 1.67.0) · sourcepub const fn ilog(self, base: usize) -> u32
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nThis method might not be optimized owing to implementation details;\nilog2
can produce results more efficiently for base 2, and ilog10
\ncan produce results more efficiently for base 10.
\n§Panics
\nThis function will panic if self
is zero, or if base
is less than 2.
\n§Examples
\nassert_eq!(5usize.ilog(5), 1);
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog(self, base: usize) -> Option<u32>
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nReturns None
if the number is zero, or if the base is not at least 2.
\nThis method might not be optimized owing to implementation details;\nchecked_ilog2
can produce results more efficiently for base 2, and\nchecked_ilog10
can produce results more efficiently for base 10.
\n§Examples
\nassert_eq!(5usize.checked_ilog(5), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog2(self) -> Option<u32>
Returns the base 2 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(2usize.checked_ilog2(), Some(1));
\n1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog10(self) -> Option<u32>
Returns the base 10 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
\n§Examples
\nassert_eq!(10usize.checked_ilog10(), Some(1));
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_neg(self) -> Option<usize>
Checked negation. Computes -self
, returning None
unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0usize.checked_neg(), Some(0));\nassert_eq!(1usize.checked_neg(), None);
\nsourcepub const fn strict_neg(self) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict negation. Computes -self
, panicking unless self == 0
.
\nNote that negating any positive integer will overflow.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0usize.strict_neg(), 0);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_neg();
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x1usize.checked_shl(4), Some(0x10));\nassert_eq!(0x10usize.checked_shl(129), None);
\nsourcepub const fn strict_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift left. Computes self << rhs
, panicking if rhs
is larger\nthan or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x1usize.strict_shl(4), 0x10);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shl(129);
\nsourcepub const unsafe fn unchecked_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift left. Computes self << rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shl
would return None
.
\n1.7.0 (const: 1.47.0) · sourcepub const fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0x10usize.checked_shr(4), Some(0x1));\nassert_eq!(0x10usize.checked_shr(129), None);
\nsourcepub const fn strict_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict shift right. Computes self >> rhs
, panicking rhs
is\nlarger than or equal to the number of bits in self
.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x10usize.strict_shr(4), 0x1);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shr(129);
\nsourcepub const unsafe fn unchecked_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
Unchecked shift right. Computes self >> rhs
, assuming that\nrhs
is less than the number of bits in self
.
\n§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shr
would return None
.
\n1.34.0 (const: 1.50.0) · sourcepub const fn checked_pow(self, exp: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_pow(5), Some(32));\nassert_eq!(usize::MAX.checked_pow(2), None);
\nsourcepub const fn strict_pow(self, exp: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
Strict exponentiation. Computes self.pow(exp)
, panicking if\noverflow occurred.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(2usize.strict_pow(5), 32);
\nThe following panics because of overflow:
\n\nⓘ#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_pow(2);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at\nthe numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_add(1), 101);\nassert_eq!(usize::MAX.saturating_add(127), usize::MAX);
\n1.66.0 (const: 1.66.0) · sourcepub const fn saturating_add_signed(self, rhs: isize) -> usize
Saturating addition with a signed integer. Computes self + rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.saturating_add_signed(2), 3);\nassert_eq!(1usize.saturating_add_signed(-2), 0);\nassert_eq!((usize::MAX - 2).saturating_add_signed(4), usize::MAX);
\n1.0.0 (const: 1.47.0) · sourcepub const fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating\nat the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_sub(27), 73);\nassert_eq!(13usize.saturating_sub(127), 0);
\n1.7.0 (const: 1.47.0) · sourcepub const fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.saturating_mul(10), 20);\nassert_eq!((usize::MAX).saturating_mul(10), usize::MAX);
\n1.58.0 (const: 1.58.0) · sourcepub const fn saturating_div(self, rhs: usize) -> usize
1.34.0 (const: 1.50.0) · sourcepub const fn saturating_pow(self, exp: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
,\nsaturating at the numeric bounds instead of overflowing.
\n§Examples
\nBasic usage:
\n\nassert_eq!(4usize.saturating_pow(3), 64);\nassert_eq!(usize::MAX.saturating_pow(2), usize::MAX);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(200usize.wrapping_add(55), 255);\nassert_eq!(200usize.wrapping_add(usize::MAX), 199);
\n1.66.0 (const: 1.66.0) · sourcepub const fn wrapping_add_signed(self, rhs: isize) -> usize
Wrapping (modular) addition with a signed integer. Computes\nself + rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_add_signed(2), 3);\nassert_eq!(1usize.wrapping_add_signed(-2), usize::MAX);\nassert_eq!((usize::MAX - 2).wrapping_add_signed(4), 1);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_sub(100), 0);\nassert_eq!(100usize.wrapping_sub(usize::MAX), 101);
\n1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u8
is used here.
\n\nassert_eq!(10u8.wrapping_mul(12), 120);\nassert_eq!(25u8.wrapping_mul(12), 44);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div(10), 10);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div_euclid(10), 10);
\n1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
.\nWrapped remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem(10), 0);
\n1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean modulo. Computes self.rem_euclid(rhs)
.\nWrapped modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem_euclid(10), 0);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type.
\nSince unsigned types do not have negative equivalents\nall applications of this function will wrap (except for -0
).\nFor values smaller than the corresponding signed type’s maximum\nthe result is the same as casting the corresponding signed value.\nAny larger values are equivalent to MAX + 1 - (val - MAX - 1)
where\nMAX
is the corresponding signed type’s maximum.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0_usize.wrapping_neg(), 0);\nassert_eq!(usize::MAX.wrapping_neg(), 1);\nassert_eq!(13_usize.wrapping_neg(), (!13) + 1);\nassert_eq!(42_usize.wrapping_neg(), !(42 - 1));
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-left; the\nRHS of a wrapping shift-left is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_left
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_shl(7), 128);\nassert_eq!(1usize.wrapping_shl(128), 1);
\n1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
\nNote that this is not the same as a rotate-right; the\nRHS of a wrapping shift-right is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_right
function,\nwhich may be what you want instead.
\n§Examples
\nBasic usage:
\n\nassert_eq!(128usize.wrapping_shr(7), 1);\nassert_eq!(128usize.wrapping_shr(128), 128);
\n1.34.0 (const: 1.50.0) · sourcepub const fn wrapping_pow(self, exp: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
,\nwrapping around at the boundary of the type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.wrapping_pow(5), 243);\nassert_eq!(3u8.wrapping_pow(6), 217);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_add(self, rhs: usize) -> (usize, bool)
Calculates self
+ rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_add(2), (7, false));\nassert_eq!(usize::MAX.overflowing_add(1), (0, true));
\nsourcepub const fn carrying_add(self, rhs: usize, carry: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
+ rhs
+ carry
and returns a tuple containing\nthe sum and the output carry.
\nPerforms “ternary addition” of two integer operands and a carry-in\nbit, and returns an output integer and a carry-out bit. This allows\nchaining together multiple additions to create a wider addition, and\ncan be useful for bignum addition.
\nThis can be thought of as a 64-bit “full adder”, in the electronics sense.
\nIf the input carry is false, this method is equivalent to\noverflowing_add
, and the output carry is\nequal to the overflow flag. Note that although carry and overflow\nflags are similar for unsigned integers, they are different for\nsigned integers.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 3 MAX (a = 3 × 2^64 + 2^64 - 1)\n// + 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 9 6 (sum = 9 × 2^64 + 6)\n\nlet (a1, a0): (usize, usize) = (3, usize::MAX);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet carry0 = false;\n\nlet (sum0, carry1) = a0.carrying_add(b0, carry0);\nassert_eq!(carry1, true);\nlet (sum1, carry2) = a1.carrying_add(b1, carry1);\nassert_eq!(carry2, false);\n\nassert_eq!((sum1, sum0), (9, 6));
\n1.66.0 (const: 1.66.0) · sourcepub const fn overflowing_add_signed(self, rhs: isize) -> (usize, bool)
Calculates self
+ rhs
with a signed rhs
\nReturns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.overflowing_add_signed(2), (3, false));\nassert_eq!(1usize.overflowing_add_signed(-2), (usize::MAX, true));\nassert_eq!((usize::MAX - 2).overflowing_add_signed(4), (1, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_sub(self, rhs: usize) -> (usize, bool)
Calculates self
- rhs
\nReturns a tuple of the subtraction along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_sub(2), (3, false));\nassert_eq!(0usize.overflowing_sub(1), (usize::MAX, true));
\nsourcepub const fn borrowing_sub(self, rhs: usize, borrow: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates self
− rhs
− borrow
and returns a tuple\ncontaining the difference and the output borrow.
\nPerforms “ternary subtraction” by subtracting both an integer\noperand and a borrow-in bit from self
, and returns an output\ninteger and a borrow-out bit. This allows chaining together multiple\nsubtractions to create a wider subtraction, and can be useful for\nbignum subtraction.
\n§Examples
\n#![feature(bigint_helper_methods)]\n\n// 9 6 (a = 9 × 2^64 + 6)\n// - 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 3 MAX (diff = 3 × 2^64 + 2^64 - 1)\n\nlet (a1, a0): (usize, usize) = (9, 6);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet borrow0 = false;\n\nlet (diff0, borrow1) = a0.borrowing_sub(b0, borrow0);\nassert_eq!(borrow1, true);\nlet (diff1, borrow2) = a1.borrowing_sub(b1, borrow1);\nassert_eq!(borrow2, false);\n\nassert_eq!((diff1, diff0), (3, usize::MAX));
\n1.60.0 (const: 1.60.0) · sourcepub const fn abs_diff(self, other: usize) -> usize
Computes the absolute difference between self
and other
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(100usize.abs_diff(80), 20usize);\nassert_eq!(100usize.abs_diff(110), 10usize);
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_mul(self, rhs: usize) -> (usize, bool)
Calculates the multiplication of self
and rhs
.
\nReturns a tuple of the multiplication along with a boolean\nindicating whether an arithmetic overflow would occur. If an\noverflow would have occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\nassert_eq!(5u32.overflowing_mul(2), (10, false));\nassert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_div(self, rhs: usize) -> (usize, bool)
Calculates the divisor when self
is divided by rhs
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div(2), (2, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
.
\nReturns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.overflowing_div(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div_euclid(2), (2, false));
\n1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_rem(self, rhs: usize) -> (usize, bool)
Calculates the remainder when self
is divided by rhs
.
\nReturns a tuple of the remainder after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem(2), (1, false));
\n1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Calculates the remainder self.rem_euclid(rhs)
as if by Euclidean division.
\nReturns a tuple of the modulo after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this operation\nis exactly equal to self.overflowing_rem(rhs)
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem_euclid(2), (1, false));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_neg(self) -> (usize, bool)
Negates self in an overflowing fashion.
\nReturns !self + 1
using wrapping operations to return the value\nthat represents the negation of this unsigned value. Note that for\npositive unsigned values overflow always occurs, but negating 0 does\nnot overflow.
\n§Examples
\nBasic usage
\n\nassert_eq!(0usize.overflowing_neg(), (0, false));\nassert_eq!(2usize.overflowing_neg(), (-2i32 as usize, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shl(self, rhs: u32) -> (usize, bool)
Shifts self left by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x1usize.overflowing_shl(4), (0x10, false));\nassert_eq!(0x1usize.overflowing_shl(132), (0x10, true));
\n1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shr(self, rhs: u32) -> (usize, bool)
Shifts self right by rhs
bits.
\nReturns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x10usize.overflowing_shr(4), (0x1, false));\nassert_eq!(0x10usize.overflowing_shr(132), (0x1, true));
\n1.34.0 (const: 1.50.0) · sourcepub const fn overflowing_pow(self, exp: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring.
\nReturns a tuple of the exponentiation along with a bool indicating\nwhether an overflow happened.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.overflowing_pow(5), (243, false));\nassert_eq!(3u8.overflowing_pow(6), (217, true));
\n1.0.0 (const: 1.50.0) · sourcepub const fn pow(self, exp: u32) -> usize
Raises self to the power of exp
, using exponentiation by squaring.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.pow(5), 32);
\nsourcepub const fn isqrt(self) -> usize
🔬This is a nightly-only experimental API. (isqrt
)
Returns the square root of the number, rounded down.
\n§Examples
\nBasic usage:
\n\n#![feature(isqrt)]\nassert_eq!(10usize.isqrt(), 3);
\n1.38.0 (const: 1.52.0) · sourcepub const fn div_euclid(self, rhs: usize) -> usize
1.38.0 (const: 1.52.0) · sourcepub const fn rem_euclid(self, rhs: usize) -> usize
Calculates the least remainder of self (mod rhs)
.
\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self % rhs
.
\n§Panics
\nThis function will panic if rhs
is 0.
\n§Examples
\nBasic usage:
\n\nassert_eq!(7usize.rem_euclid(4), 3); // or any other integer type
\nsourcepub const fn div_floor(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (int_roundings
)
Calculates the quotient of self
and rhs
, rounding the result towards negative infinity.
\nThis is the same as performing self / rhs
for all unsigned integers.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Examples
\nBasic usage:
\n\n#![feature(int_roundings)]\nassert_eq!(7_usize.div_floor(4), 1);
\n1.73.0 (const: 1.73.0) · sourcepub const fn next_multiple_of(self, rhs: usize) -> usize
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
.
\n§Panics
\nThis function will panic if rhs
is zero.
\n§Overflow behavior
\nOn overflow, this function will panic if overflow checks are enabled (default in debug\nmode) and wrap if overflow checks are disabled (default in release mode).
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.next_multiple_of(8), 16);\nassert_eq!(23_usize.next_multiple_of(8), 24);
\n1.73.0 (const: 1.73.0) · sourcepub const fn checked_next_multiple_of(self, rhs: usize) -> Option<usize>
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
. Returns None
if rhs
is zero or the\noperation would result in overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.checked_next_multiple_of(8), Some(16));\nassert_eq!(23_usize.checked_next_multiple_of(8), Some(24));\nassert_eq!(1_usize.checked_next_multiple_of(0), None);\nassert_eq!(usize::MAX.checked_next_multiple_of(2), None);
\n1.0.0 (const: 1.32.0) · sourcepub const fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.
\n§Examples
\nBasic usage:
\n\nassert!(16usize.is_power_of_two());\nassert!(!10usize.is_power_of_two());
\n1.0.0 (const: 1.50.0) · sourcepub const fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
.
\nWhen return value overflows (i.e., self > (1 << (N-1))
for type\nuN
), it panics in debug mode and the return value is wrapped to 0 in\nrelease mode (the only situation in which this method can return 0).
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.next_power_of_two(), 2);\nassert_eq!(3usize.next_power_of_two(), 4);\nassert_eq!(0usize.next_power_of_two(), 1);
\n1.0.0 (const: 1.50.0) · sourcepub const fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to self
. If\nthe next power of two is greater than the type’s maximum value,\nNone
is returned, otherwise the power of two is wrapped in Some
.
\n§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_next_power_of_two(), Some(2));\nassert_eq!(3usize.checked_next_power_of_two(), Some(4));\nassert_eq!(usize::MAX.checked_next_power_of_two(), None);
\nsourcepub const fn wrapping_next_power_of_two(self) -> usize
🔬This is a nightly-only experimental API. (wrapping_next_power_of_two
)
Returns the smallest power of two greater than or equal to n
. If\nthe next power of two is greater than the type’s maximum value,\nthe return value is wrapped to 0
.
\n§Examples
\nBasic usage:
\n\n#![feature(wrapping_next_power_of_two)]\n\nassert_eq!(2usize.wrapping_next_power_of_two(), 2);\nassert_eq!(3usize.wrapping_next_power_of_two(), 4);\nassert_eq!(usize::MAX.wrapping_next_power_of_two(), 0);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_be_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nbig-endian (network) byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_be_bytes();\nassert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_le_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nlittle-endian byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_le_bytes();\nassert_eq!(bytes, [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
\n1.32.0 (const: 1.44.0) · sourcepub const fn to_ne_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nnative byte order.
\nAs the target platform’s native endianness is used, portable code\nshould use to_be_bytes
or to_le_bytes
, as appropriate,\ninstead.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_ne_bytes();\nassert_eq!(\n bytes,\n if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n } else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n }\n);
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_be_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in big endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_be_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_be_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_le_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in little endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_le_bytes([0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_le_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_le_bytes(int_bytes.try_into().unwrap())\n}
\n1.32.0 (const: 1.44.0) · sourcepub const fn from_ne_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its memory representation\nas a byte array in native endianness.
\nAs the target platform’s native endianness is used, portable code\nlikely wants to use from_be_bytes
or from_le_bytes
, as\nappropriate instead.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_ne_bytes(if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n} else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n});\nassert_eq!(value, 0x1234567890123456);
\nWhen starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_ne_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_ne_bytes(int_bytes.try_into().unwrap())\n}
\n1.0.0 (const: 1.32.0) · sourcepub const fn min_value() -> usize
👎Deprecating in a future version: replaced by the MIN
associated constant on this type
New code should prefer to use\nusize::MIN
instead.
\nReturns the smallest value that can be represented by this integer type.
\n1.0.0 (const: 1.32.0) · sourcepub const fn max_value() -> usize
👎Deprecating in a future version: replaced by the MAX
associated constant on this type
New code should prefer to use\nusize::MAX
instead.
\nReturns the largest value that can be represented by this integer type.
\nsourcepub const fn widening_mul(self, rhs: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the complete product self * rhs
without the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nIf you also need to add a carry to the wide result, then you want\nSelf::carrying_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.widening_mul(2), (10, 0));\nassert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));
\nsourcepub const fn carrying_mul(self, rhs: usize, carry: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
Calculates the “full multiplication” self * rhs + carry
\nwithout the possibility to overflow.
\nThis returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nPerforms “long multiplication” which takes in an extra amount to add, and may return an\nadditional amount of overflow. This allows for chaining together multiple\nmultiplications to create “big integers” which represent larger values.
\nIf you don’t need the carry
, then you can use Self::widening_mul
instead.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(5u32.carrying_mul(2, 0), (10, 0));\nassert_eq!(5u32.carrying_mul(2, 10), (20, 0));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));\nassert_eq!(usize::MAX.carrying_mul(usize::MAX, usize::MAX), (0, usize::MAX));
\nThis is the core operation needed for scalar multiplication when\nimplementing it for wider-than-native types.
\n\n#![feature(bigint_helper_methods)]\nfn scalar_mul_eq(little_endian_digits: &mut Vec<u16>, multiplicand: u16) {\n let mut carry = 0;\n for d in little_endian_digits.iter_mut() {\n (*d, carry) = d.carrying_mul(multiplicand, carry);\n }\n if carry != 0 {\n little_endian_digits.push(carry);\n }\n}\n\nlet mut v = vec![10, 20];\nscalar_mul_eq(&mut v, 3);\nassert_eq!(v, [30, 60]);\n\nassert_eq!(0x87654321_u64 * 0xFEED, 0x86D3D159E38D);\nlet mut v = vec![0x4321, 0x8765];\nscalar_mul_eq(&mut v, 0xFEED);\nassert_eq!(v, [0xE38D, 0xD159, 0x86D3]);
\nIf carry
is zero, this is similar to overflowing_mul
,\nexcept that it gives the value of the overflow instead of just whether one happened:
\n\n#![feature(bigint_helper_methods)]\nlet r = u8::carrying_mul(7, 13, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));\nlet r = u8::carrying_mul(13, 42, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(13, 42));
\nThe value of the first field in the returned tuple matches what you’d get\nby combining the wrapping_mul
and\nwrapping_add
methods:
\n\n#![feature(bigint_helper_methods)]\nassert_eq!(\n 789_u16.carrying_mul(456, 123).0,\n 789_u16.wrapping_mul(456).wrapping_add(123),\n);
\nsourcepub const fn midpoint(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (num_midpoint
)
Calculates the middle point of self
and rhs
.
\nmidpoint(a, b)
is (a + b) >> 1
as if it were performed in a\nsufficiently-large signed integral type. This implies that the result is\nalways rounded towards negative infinity and that no overflow will ever occur.
\n§Examples
\n#![feature(num_midpoint)]\nassert_eq!(0usize.midpoint(4), 2);\nassert_eq!(1usize.midpoint(4), 2);
\n",0,"gosling::context::HandshakeHandle"],["source§impl usize
1.0.0 (const: unstable) · sourcepub fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer.
\nThe string is expected to be an optional +
sign\nfollowed by digits.\nLeading and trailing whitespace represent an error.\nDigits are a subset of these characters, depending on radix
:
\n\n0-9
\na-z
\nA-Z
\n
\n§Panics
\nThis function panics if radix
is not in the range from 2 to 36.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::from_str_radix(\"A\", 16), Ok(10));
\n",0,"gosling::context::HandshakeHandle"],["§impl AtLeast16 for usize
","AtLeast16","gosling::context::HandshakeHandle"],["§impl AtLeast32 for usize
","AtLeast32","gosling::context::HandshakeHandle"],["§impl AtLeast64 for usize
","AtLeast64","gosling::context::HandshakeHandle"],["§impl AtLeast8 for usize
","AtLeast8","gosling::context::HandshakeHandle"],["§impl AtMost128 for usize
","AtMost128","gosling::context::HandshakeHandle"],["§impl AtMost64 for usize
","AtMost64","gosling::context::HandshakeHandle"],["§impl BitOps for usize
","BitOps","gosling::context::HandshakeHandle"],["source§impl ConstParamTy for usize
","ConstParamTy","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Copy for usize
","Copy","gosling::context::HandshakeHandle"],["§impl DefaultIsZeroes for usize
","DefaultIsZeroes","gosling::context::HandshakeHandle"],["1.0.0 · source§impl Eq for usize
","Eq","gosling::context::HandshakeHandle"],["§impl ExtendTarget<usize> for usize
","ExtendTarget","gosling::context::HandshakeHandle"],["source§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["§impl Index for usize
","Index","gosling::context::HandshakeHandle"],["source§impl Integer for usize
","Integer","gosling::context::HandshakeHandle"],["§impl Is64 for usize
","Is64","gosling::context::HandshakeHandle"],["§impl NotAutoValue for usize
","NotAutoValue","gosling::context::HandshakeHandle"],["§impl NumericOps for usize
","NumericOps","gosling::context::HandshakeHandle"],["source§impl SimdCast for usize
","SimdCast","gosling::context::HandshakeHandle"],["source§impl StructuralPartialEq for usize
","StructuralPartialEq","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u16> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<u8> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["§impl TruncateTarget<usize> for usize
","TruncateTarget","gosling::context::HandshakeHandle"],["source§impl TrustedStep for usize
","TrustedStep","gosling::context::HandshakeHandle"],["§impl Uint for usize
","Uint","gosling::context::HandshakeHandle"],["source§impl Unsigned for usize
","Unsigned","gosling::context::HandshakeHandle"],["source§impl Weight for usize
","Weight","gosling::context::HandshakeHandle"],["source§impl ZeroablePrimitive for usize
","ZeroablePrimitive","gosling::context::HandshakeHandle"]],
-"tor_interface":[["","Accumulate","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Add<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Add<&usize>","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["","Add","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
Performs the +=
operation. Read more","AddAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
Performs the +=
operation. Read more","AddAssign","tor_interface::tor_provider::CircuitToken"],["","AsAny","tor_interface::tor_provider::CircuitToken"],["§impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
Gets the bytes of this value mutably. Read more§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
","AsBytes","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<f64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<i8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<isize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u128> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u16> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u32> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u64> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<u8> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["source§impl AsPrimitive<usize> for usize
","AsPrimitive","tor_interface::tor_provider::CircuitToken"],["","Binary","tor_interface::tor_provider::CircuitToken"],["","BitAnd<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitAnd","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
Performs the &=
operation. Read more","BitAndAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
Performs the &=
operation. Read more","BitAndAssign","tor_interface::tor_provider::CircuitToken"],["","BitOr<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitOr","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
Performs the |=
operation. Read more","BitOrAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
Performs the |=
operation. Read more","BitOrAssign","tor_interface::tor_provider::CircuitToken"],["","BitRegister","tor_interface::tor_provider::CircuitToken"],["§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
Immutably indexes into a bit-slice without doing any bounds checking. Read more§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
Mutably indexes into a bit-slice without doing any bounds checking. Read more","BitSliceIndex<'a, T, O>","tor_interface::tor_provider::CircuitToken"],["§impl BitStore for usize
§type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
\n§type Mem = usize
The element type used in the memory region underlying a BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
A sibling BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
The inverse of ::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
Loads a value out of the memory system according to the ::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
Stores a value into the memory system. This is only called when there\nare no other handles to the value, and it may bypass ::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
All implementors are required to have their alignment match their size. Read more§const ALIAS_WIDTH: [(); 1] = _
All implementors are required to have Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more","BitStore","tor_interface::tor_provider::CircuitToken"],["","BitXor<&usize>","tor_interface::tor_provider::CircuitToken"],["","BitXor","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
Performs the ^=
operation. Read more","BitXorAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
Performs the ^=
operation. Read more","BitXorAssign","tor_interface::tor_provider::CircuitToken"],["","Bits","tor_interface::tor_provider::CircuitToken"],["","Bounded","tor_interface::tor_provider::CircuitToken"],["","CastSigned","tor_interface::tor_provider::CircuitToken"],["","CastUnsigned","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedAdd for usize
","CheckedAdd","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedDiv for usize
","CheckedDiv","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
Performs euclid division that returns None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
Finds the euclid remainder of dividing two numbers, checking for underflow, overflow and\ndivision by zero. If any of that happens, None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Returns both the quotient and remainder from checked Euclidean division. Read more","CheckedEuclid","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedMul for usize
","CheckedMul","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedNeg for usize
","CheckedNeg","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedRem for usize
","CheckedRem","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShl for usize
","CheckedShl","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedShr for usize
","CheckedShr","tor_interface::tor_provider::CircuitToken"],["source§impl CheckedSub for usize
","CheckedSub","tor_interface::tor_provider::CircuitToken"],["§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
Iterate over the values of this type, computing a checked sum. Read more","CheckedSum","tor_interface::tor_provider::CircuitToken"],["","Clone","tor_interface::tor_provider::CircuitToken"],["","ConstOne","tor_interface::tor_provider::CircuitToken"],["","ConstZero","tor_interface::tor_provider::CircuitToken"],["source§impl ConstantTimeEq for usize
","ConstantTimeEq","tor_interface::tor_provider::CircuitToken"],["","Debug","tor_interface::tor_provider::CircuitToken"],["§impl Decode for usize
Decode a usize
.
\nUses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
\nEnforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
\n","Decode","tor_interface::tor_provider::CircuitToken"],["","Default","tor_interface::tor_provider::CircuitToken"],["source§impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more","Deserialize<'de>","tor_interface::tor_provider::CircuitToken"],["","Display","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Div<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Div<&usize>","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div","tor_interface::tor_provider::CircuitToken"],["","Div>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Div","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
Performs the /=
operation. Read more","DivAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n","DivAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
Performs the /=
operation. Read more","DivAssign","tor_interface::tor_provider::CircuitToken"],["§impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
\nUses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
\n§fn encoded_len(&self) -> Result<usize, Error>
Get the length of this type encoded in bytes, prior to Base64 encoding.§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value using the provided [Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a\nuint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a uint32
length prefix\nset to [Encode::encoded_len
].","Encode","tor_interface::tor_provider::CircuitToken"],["source§impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
Calculates Euclidean division, the matching method for rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
Calculates the least nonnegative remainder of self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Returns both the quotient and remainder from Euclidean division. Read more","Euclid","tor_interface::tor_provider::CircuitToken"],["","FmtConst","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From>","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["","From","tor_interface::tor_provider::CircuitToken"],["source§impl FromBytes for usize
§type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
Create a number from its representation as a byte array in big endian. Read more","FromBytes","tor_interface::tor_provider::CircuitToken"],["§impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
Interprets the prefix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
Interprets the suffix of the given bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
Interprets the prefix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
Interprets the suffix of the given bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
","FromBytes","tor_interface::tor_provider::CircuitToken"],["source§impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
Converts an isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
Converts an i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
Converts an i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
Converts an i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
Converts an i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
Converts an i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
Converts a usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
Converts an u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
Converts an u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
Converts an u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
Converts an u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
Converts an u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more","FromPrimitive","tor_interface::tor_provider::CircuitToken"],["§impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
Converts SQLite value into Rust value.","FromSql","tor_interface::tor_provider::CircuitToken"],["","FromStr","tor_interface::tor_provider::CircuitToken"],["","FromZeroes","tor_interface::tor_provider::CircuitToken"],["","Fundamental","tor_interface::tor_provider::CircuitToken"],["","Hash","tor_interface::tor_provider::CircuitToken"],["source§impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
\nsource§fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
\nsource§fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
\nsource§fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
\nsource§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
\nsource§fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
\nsource§fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
Greatest common divisor, least common multiple, and Bézout coefficients.source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
Greatest common divisor and Bézout coefficients. Read moresource§fn divides(&self, other: &Self) -> bool
👎Deprecated: Please use is_multiple_of insteadDeprecated, use is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.\nReturns (quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
Rounds up to nearest multiple of argument. Read more","Integer","tor_interface::tor_provider::CircuitToken"],["§impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer. Read more§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of\nself
.§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of\nself
.§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of\nself
.§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of\nself
.§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
Reverses the byte order of the integer.§fn reverse_bits(self) -> usize
Reverses the bit pattern of the integer.§fn from_le(self) -> usize
Converts an integer frm little endian to the target’s endianness. Read more§fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
Negates self, overflowing if this is equal to the minimum value. Read more§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
Calculates the quotient of Euclidean division of self by rhs. Read more§fn rem_euclid(self, rhs: usize) -> usize
Calculates the least nonnegative remainder of self (mod rhs)
. Read more","Integral","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
Converts the value of self
to a BigInt
.","IntoBigInt","tor_interface::tor_provider::CircuitToken"],["source§impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
Converts the value of self
to a BigUint
.","IntoBigUint","tor_interface::tor_provider::CircuitToken"],["source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
The type of the deserializer being converted into.source§fn into_deserializer(self) -> UsizeDeserializer<E>
Convert this value into a deserializer.","IntoDeserializer<'de, E>","tor_interface::tor_provider::CircuitToken"],["§impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
Convert this value into a notification. Read more§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
Convert this value into an additional notification. Read more§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
Don’t emit a fence for this notification. Read more","IntoNotification","tor_interface::tor_provider::CircuitToken"],["","LowerExp","tor_interface::tor_provider::CircuitToken"],["","LowerHex","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Mul<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Mul<&usize>","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","Mul","tor_interface::tor_provider::CircuitToken"],["","MulAdd","tor_interface::tor_provider::CircuitToken"],["source§impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
Performs the fused multiply-add assignment operation *self = (*self * a) + b
","MulAddAssign","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
Performs the *=
operation. Read more","MulAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
Performs the *=
operation. Read more","MulAssign","tor_interface::tor_provider::CircuitToken"],["","Not","tor_interface::tor_provider::CircuitToken"],["source§impl Num for usize
§type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
Convert from a string and radix (typically 2..=36
). Read more","Num","tor_interface::tor_provider::CircuitToken"],["","NumCast","tor_interface::tor_provider::CircuitToken"],["§impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nbig-endian (network) byte order.§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nlittle-endian byte order.§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
Return the memory representation of this number as a byte array in\nnative byte order.§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in big\nendian.§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its representation as a byte array in little\nendian.§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
Create a numeric value from its memory representation as a byte array in\nnative endianness.","Numeric","tor_interface::tor_provider::CircuitToken"],["","Octal","tor_interface::tor_provider::CircuitToken"],["","One","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Ord for usize
","Ord","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingAdd for usize
","OverflowingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingMul for usize
","OverflowingMul","tor_interface::tor_provider::CircuitToken"],["source§impl OverflowingSub for usize
","OverflowingSub","tor_interface::tor_provider::CircuitToken"],["","ParseHex","tor_interface::tor_provider::CircuitToken"],["source§impl PartialEq<Value> for usize
","PartialEq","tor_interface::tor_provider::CircuitToken"],["","PartialEq","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
\noperator. Read more","PartialOrd","tor_interface::tor_provider::CircuitToken"],["","PhfBorrow","tor_interface::tor_provider::CircuitToken"],["","PhfHash","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u16>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u32>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a u8>","tor_interface::tor_provider::CircuitToken"],["","Pow<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow>","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["","Pow","tor_interface::tor_provider::CircuitToken"],["source§impl PrimInt for usize
source§fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
. Read moresource§fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
. Read moresource§fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation\nof self
. Read moresource§fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation\nof self
. Read moresource§fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
. Read moresource§fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
. Read moresource§fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
Reverses the byte order of the integer. Read moresource§fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. Read moresource§fn from_be(x: usize) -> usize
Convert an integer from big endian to the target’s endianness. Read more","PrimInt","tor_interface::tor_provider::CircuitToken"],["","Product<&'a usize>","tor_interface::tor_provider::CircuitToken"],["","Product","tor_interface::tor_provider::CircuitToken"],["§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Normalizes a range-like type to a canonical half-open Range
. Read more","RangeExt","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigInt>","tor_interface::tor_provider::CircuitToken"],["","Rem<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["","Rem<&usize>","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem","tor_interface::tor_provider::CircuitToken"],["","Rem>","tor_interface::tor_provider::CircuitToken"],["1.0.0 · source§impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
\n§Panics
\nThis operation will panic if other == 0
.
\n","Rem","tor_interface::tor_provider::CircuitToken"],["source§impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
Performs the %=
operation. Read more","RemAssign<&'a BigUint>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
Performs the %=
operation. Read more","RemAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["source§impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
\n","RemAssign>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
Performs the %=
operation. Read more","RemAssign","tor_interface::tor_provider::CircuitToken"],["source§impl Roots for usize
","Roots","tor_interface::tor_provider::CircuitToken"],["","RowIndex","tor_interface::tor_provider::CircuitToken"],["source§impl SampleUniform for usize
§type Sampler = UniformInt<usize>
The UniformSampler
implementation supporting type X
.","SampleUniform","tor_interface::tor_provider::CircuitToken"],["source§impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
Saturating addition operator.\nReturns a+b, saturating at the numeric bounds instead of overflowing.source§fn saturating_sub(self, v: usize) -> usize
Saturating subtraction operator.\nReturns a-b, saturating at the numeric bounds instead of overflowing.","Saturating","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
Saturating addition. Computes self + other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingAdd","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingMul","tor_interface::tor_provider::CircuitToken"],["source§impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
Saturating subtraction. Computes self - other
, saturating at the relevant high or low boundary of\nthe type.","SaturatingSub","tor_interface::tor_provider::CircuitToken"],["§impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
Try to get position for block number block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
Try to get block number and bytes position for given block size bs
.","SeekNum","tor_interface::tor_provider::CircuitToken"],["source§impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
Serialize this value into the given Serde serializer. Read more","Serialize","tor_interface::tor_provider::CircuitToken"],["","Shl<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shl<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shl<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["","Shl","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
Performs the <<=
operation. Read more","ShlAssign<&i128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
Performs the <<=
operation. Read more","ShlAssign<&i16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
Performs the <<=
operation. Read more","ShlAssign<&i32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
Performs the <<=
operation. Read more","ShlAssign<&i64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
Performs the <<=
operation. Read more","ShlAssign<&i8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
Performs the <<=
operation. Read more","ShlAssign<&isize>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
Performs the <<=
operation. Read more","ShlAssign<&u128>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
Performs the <<=
operation. Read more","ShlAssign<&u16>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
Performs the <<=
operation. Read more","ShlAssign<&u32>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
Performs the <<=
operation. Read more","ShlAssign<&u64>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
Performs the <<=
operation. Read more","ShlAssign<&u8>","tor_interface::tor_provider::CircuitToken"],["1.22.0 · source§impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
Performs the <<=
operation. Read more","ShlAssign<&usize>","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["1.8.0 · source§impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
Performs the <<=
operation. Read more","ShlAssign","tor_interface::tor_provider::CircuitToken"],["","Shr<&i128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&i8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&isize>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u128>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u16>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u32>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u64>","tor_interface::tor_provider::CircuitToken"],["","Shr<&u8>","tor_interface::tor_provider::CircuitToken"],["","Shr<&usize>","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["","Shr","tor_interface::tor_provider::CircuitToken"],["
1.22.0 · source§impl AddAssign<&usize> for usize
impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
fn add_assign(&mut self, other: &usize)
+=
operation. Read more1.8.0 · source§impl AddAssign for usize
impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
fn add_assign(&mut self, other: usize)
+=
operation. Read more§impl AsBytes for usize
impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
source§impl AsPrimitive<f32> for usize
impl AsPrimitive<f32> for usize
source§impl AsPrimitive<f64> for usize
impl AsPrimitive<f64> for usize
source§impl AsPrimitive<i128> for usize
impl AsPrimitive<i128> for usize
source§impl AsPrimitive<i16> for usize
impl AsPrimitive<i16> for usize
source§impl AsPrimitive<i32> for usize
impl AsPrimitive<i32> for usize
source§impl AsPrimitive<i64> for usize
impl AsPrimitive<i64> for usize
source§impl AsPrimitive<i8> for usize
impl AsPrimitive<i8> for usize
source§impl AsPrimitive<isize> for usize
impl AsPrimitive<isize> for usize
source§impl AsPrimitive<u128> for usize
impl AsPrimitive<u128> for usize
source§impl AsPrimitive<u16> for usize
impl AsPrimitive<u16> for usize
source§impl AsPrimitive<u32> for usize
impl AsPrimitive<u32> for usize
source§impl AsPrimitive<u64> for usize
impl AsPrimitive<u64> for usize
source§impl AsPrimitive<u8> for usize
impl AsPrimitive<u8> for usize
source§impl AsPrimitive<usize> for usize
impl AsPrimitive<usize> for usize
1.22.0 · source§impl BitAndAssign<&usize> for usize
impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
fn bitand_assign(&mut self, other: &usize)
&=
operation. Read more1.8.0 · source§impl BitAndAssign for usize
impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
fn bitand_assign(&mut self, other: usize)
&=
operation. Read more1.22.0 · source§impl BitOrAssign<&usize> for usize
impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
fn bitor_assign(&mut self, other: &usize)
|=
operation. Read more1.8.0 · source§impl BitOrAssign for usize
impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
fn bitor_assign(&mut self, other: usize)
|=
operation. Read more§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
§impl BitStore for usize
impl BitStore for usize
§type Access = Cell<usize>
type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
§type Mem = usize
type Mem = usize
BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
type Alias = BitSafeUsize
BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
type Unalias = usize
::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
fn load_value(&self) -> <usize as BitStore>::Mem
::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
fn store_value(&mut self, value: <usize as BitStore>::Mem)
::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
const ALIGNED_TO_SIZE: [(); 1] = _
§const ALIAS_WIDTH: [(); 1] = _
const ALIAS_WIDTH: [(); 1] = _
Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more1.22.0 · source§impl BitXorAssign<&usize> for usize
impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
fn bitxor_assign(&mut self, other: &usize)
^=
operation. Read more1.8.0 · source§impl BitXorAssign for usize
impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
fn bitxor_assign(&mut self, other: usize)
^=
operation. Read moresource§impl CheckedAdd for usize
impl CheckedAdd for usize
source§impl CheckedDiv for usize
impl CheckedDiv for usize
source§impl CheckedEuclid for usize
impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
fn checked_div_euclid(&self, v: &usize) -> Option<usize>
None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
source§impl CheckedMul for usize
impl CheckedMul for usize
source§impl CheckedNeg for usize
impl CheckedNeg for usize
source§impl CheckedRem for usize
impl CheckedRem for usize
source§impl CheckedShl for usize
impl CheckedShl for usize
source§impl CheckedShr for usize
impl CheckedShr for usize
source§impl CheckedSub for usize
impl CheckedSub for usize
§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
fn checked_sum(self) -> Result<usize, Error>
source§impl ConstantTimeEq for usize
impl ConstantTimeEq for usize
§impl Decode for usize
impl Decode for usize
Decode a usize
.
Uses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
Enforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
source§impl<'de> Deserialize<'de> for usize
impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
1.0.0 · source§impl Div for usize
impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
1.22.0 · source§impl DivAssign<&usize> for usize
impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
fn div_assign(&mut self, other: &usize)
/=
operation. Read more1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n1.8.0 · source§impl DivAssign for usize
impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
fn div_assign(&mut self, other: usize)
/=
operation. Read more§impl Encode for usize
impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
Uses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
§fn encoded_len(&self) -> Result<usize, Error>
fn encoded_len(&self) -> Result<usize, Error>
§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
fn encoded_len_prefixed(&self) -> Result<usize, Error>
uint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
uint32
length prefix\nset to [Encode::encoded_len
].source§impl Euclid for usize
impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
fn div_euclid(&self, v: &usize) -> usize
rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
fn rem_euclid(&self, v: &usize) -> usize
self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
source§impl FromBytes for usize
impl FromBytes for usize
type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
§impl FromBytes for usize
impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
source§impl FromPrimitive for usize
impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
fn from_isize(n: isize) -> Option<usize>
isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
fn from_i8(n: i8) -> Option<usize>
i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
fn from_i16(n: i16) -> Option<usize>
i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
fn from_i32(n: i32) -> Option<usize>
i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
fn from_i64(n: i64) -> Option<usize>
i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
fn from_i128(n: i128) -> Option<usize>
i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
fn from_usize(n: usize) -> Option<usize>
usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
fn from_u8(n: u8) -> Option<usize>
u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
fn from_u16(n: u16) -> Option<usize>
u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
fn from_u32(n: u32) -> Option<usize>
u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
fn from_u64(n: u64) -> Option<usize>
u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
fn from_u128(n: u128) -> Option<usize>
u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more§impl FromSql for usize
impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
source§impl Integer for usize
impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
source§fn mod_floor(&self, other: &usize) -> usize
fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
source§fn gcd(&self, other: &usize) -> usize
fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
source§fn lcm(&self, other: &usize) -> usize
fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
source§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
source§fn is_multiple_of(&self, other: &usize) -> bool
fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
source§fn div_rem(&self, other: &usize) -> (usize, usize)
fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
source§fn divides(&self, other: &Self) -> bool
fn divides(&self, other: &Self) -> bool
is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
fn div_mod_floor(&self, other: &Self) -> (Self, Self)
(quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
§impl Integral for usize
impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
§fn count_ones(self) -> u32
fn count_ones(self) -> u32
self
.§fn count_zeros(self) -> u32
fn count_zeros(self) -> u32
self
.§fn leading_zeros(self) -> u32
fn leading_zeros(self) -> u32
self
.§fn trailing_zeros(self) -> u32
fn trailing_zeros(self) -> u32
self
.§fn leading_ones(self) -> u32
fn leading_ones(self) -> u32
self
.§fn trailing_ones(self) -> u32
fn trailing_ones(self) -> u32
self
.§fn rotate_left(self, n: u32) -> usize
fn rotate_left(self, n: u32) -> usize
n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
fn rotate_right(self, n: u32) -> usize
n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
fn swap_bytes(self) -> usize
§fn reverse_bits(self) -> usize
fn reverse_bits(self) -> usize
§fn from_le(self) -> usize
fn from_le(self) -> usize
§fn checked_add(self, rhs: usize) -> Option<usize>
fn checked_add(self, rhs: usize) -> Option<usize>
self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
fn checked_sub(self, rhs: usize) -> Option<usize>
self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
fn checked_mul(self, rhs: usize) -> Option<usize>
self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
fn checked_div(self, rhs: usize) -> Option<usize>
self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
fn checked_div_euclid(self, rhs: usize) -> Option<usize>
self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
fn checked_rem(self, rhs: usize) -> Option<usize>
self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
fn checked_shl(self, rhs: u32) -> Option<usize>
self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
fn checked_shr(self, rhs: u32) -> Option<usize>
self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
fn checked_pow(self, rhs: u32) -> Option<usize>
self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
fn saturating_add(self, rhs: usize) -> usize
self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
fn saturating_sub(self, rhs: usize) -> usize
self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
fn saturating_mul(self, rhs: usize) -> usize
self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
fn saturating_pow(self, rhs: u32) -> usize
self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
fn wrapping_add(self, rhs: usize) -> usize
self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
fn wrapping_sub(self, rhs: usize) -> usize
self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
fn wrapping_mul(self, rhs: usize) -> usize
self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
fn wrapping_div(self, rhs: usize) -> usize
self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
fn wrapping_div_euclid(self, rhs: usize) -> usize
self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
fn wrapping_rem(self, rhs: usize) -> usize
self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
fn wrapping_rem_euclid(self, rhs: usize) -> usize
self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
fn wrapping_neg(self) -> usize
-self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
fn wrapping_shl(self, rhs: u32) -> usize
self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
fn wrapping_shr(self, rhs: u32) -> usize
self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
fn wrapping_pow(self, rhs: u32) -> usize
self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
fn overflowing_neg(self) -> (usize, bool)
§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
fn overflowing_pow(self, rhs: u32) -> (usize, bool)
exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
fn div_euclid(self, rhs: usize) -> usize
§fn rem_euclid(self, rhs: usize) -> usize
fn rem_euclid(self, rhs: usize) -> usize
self (mod rhs)
. Read moresource§impl IntoBigInt for usize
impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
fn into_bigint(self) -> Option<BigInt>
self
to a BigInt
.source§impl IntoBigUint for usize
impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
fn into_biguint(self) -> Option<BigUint>
self
to a BigUint
.source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
type Deserializer = UsizeDeserializer<E>
source§fn into_deserializer(self) -> UsizeDeserializer<E>
fn into_deserializer(self) -> UsizeDeserializer<E>
§impl IntoNotification for usize
impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
fn into_notification(self) -> <usize as IntoNotification>::Notify
§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
source§impl MulAddAssign for usize
impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
fn mul_add_assign(&mut self, a: usize, b: usize)
*self = (*self * a) + b
1.22.0 · source§impl MulAssign<&usize> for usize
impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
fn mul_assign(&mut self, other: &usize)
*=
operation. Read more1.8.0 · source§impl MulAssign for usize
impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
fn mul_assign(&mut self, other: usize)
*=
operation. Read moresource§impl Num for usize
impl Num for usize
type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
2..=36
). Read more§impl Numeric for usize
impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
fn to_be_bytes(self) -> <usize as Numeric>::Bytes
§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
fn to_le_bytes(self) -> <usize as Numeric>::Bytes
§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
1.0.0 · source§impl Ord for usize
impl Ord for usize
source§impl OverflowingAdd for usize
impl OverflowingAdd for usize
source§impl OverflowingMul for usize
impl OverflowingMul for usize
source§impl OverflowingSub for usize
impl OverflowingSub for usize
source§impl PartialEq<Value> for usize
impl PartialEq<Value> for usize
1.0.0 · source§impl PartialOrd for usize
impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
fn le(&self, other: &usize) -> bool
self
and other
) and is used by the <=
\noperator. Read moresource§impl PrimInt for usize
impl PrimInt for usize
source§fn count_ones(self) -> u32
fn count_ones(self) -> u32
self
. Read moresource§fn count_zeros(self) -> u32
fn count_zeros(self) -> u32
self
. Read moresource§fn leading_ones(self) -> u32
fn leading_ones(self) -> u32
self
. Read moresource§fn leading_zeros(self) -> u32
fn leading_zeros(self) -> u32
self
. Read moresource§fn trailing_ones(self) -> u32
fn trailing_ones(self) -> u32
self
. Read moresource§fn trailing_zeros(self) -> u32
fn trailing_zeros(self) -> u32
self
. Read moresource§fn rotate_left(self, n: u32) -> usize
fn rotate_left(self, n: u32) -> usize
n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
fn rotate_right(self, n: u32) -> usize
n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
fn signed_shl(self, n: u32) -> usize
n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
fn signed_shr(self, n: u32) -> usize
n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
fn unsigned_shl(self, n: u32) -> usize
n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
fn unsigned_shr(self, n: u32) -> usize
n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
fn swap_bytes(self) -> usize
source§fn reverse_bits(self) -> usize
fn reverse_bits(self) -> usize
source§fn from_be(x: usize) -> usize
fn from_be(x: usize) -> usize
§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Range
. Read more1.0.0 · source§impl Rem for usize
impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
§Panics
\nThis operation will panic if other == 0
.
source§impl<'a> RemAssign<&'a BigUint> for usize
impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
fn rem_assign(&mut self, other: &BigUint)
%=
operation. Read more1.22.0 · source§impl RemAssign<&usize> for usize
impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
fn rem_assign(&mut self, other: &usize)
%=
operation. Read moresource§impl RemAssign<BigUint> for usize
impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
fn rem_assign(&mut self, other: BigUint)
%=
operation. Read more1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
1.8.0 · source§impl RemAssign for usize
impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
fn rem_assign(&mut self, other: usize)
%=
operation. Read moresource§impl Roots for usize
impl Roots for usize
source§impl SampleUniform for usize
impl SampleUniform for usize
§type Sampler = UniformInt<usize>
type Sampler = UniformInt<usize>
UniformSampler
implementation supporting type X
.source§impl Saturating for usize
impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
fn saturating_add(self, v: usize) -> usize
source§fn saturating_sub(self, v: usize) -> usize
fn saturating_sub(self, v: usize) -> usize
source§impl SaturatingAdd for usize
impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
fn saturating_add(&self, v: &usize) -> usize
self + other
, saturating at the relevant high or low boundary of\nthe type.source§impl SaturatingMul for usize
impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
fn saturating_mul(&self, v: &usize) -> usize
self * other
, saturating at the relevant high or low boundary of\nthe type.source§impl SaturatingSub for usize
impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
fn saturating_sub(&self, v: &usize) -> usize
self - other
, saturating at the relevant high or low boundary of\nthe type.§impl SeekNum for usize
impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
bs
.source§impl Serialize for usize
impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
1.22.0 · source§impl ShlAssign<&i128> for usize
impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
fn shl_assign(&mut self, other: &i128)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&i16> for usize
impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
fn shl_assign(&mut self, other: &i16)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&i32> for usize
impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
fn shl_assign(&mut self, other: &i32)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&i64> for usize
impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
fn shl_assign(&mut self, other: &i64)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&i8> for usize
impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
fn shl_assign(&mut self, other: &i8)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&isize> for usize
impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
fn shl_assign(&mut self, other: &isize)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&u128> for usize
impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
fn shl_assign(&mut self, other: &u128)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&u16> for usize
impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
fn shl_assign(&mut self, other: &u16)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&u32> for usize
impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
fn shl_assign(&mut self, other: &u32)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&u64> for usize
impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
fn shl_assign(&mut self, other: &u64)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&u8> for usize
impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
fn shl_assign(&mut self, other: &u8)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&usize> for usize
impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
fn shl_assign(&mut self, other: &usize)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<i128> for usize
impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
fn shl_assign(&mut self, other: i128)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<i16> for usize
impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
fn shl_assign(&mut self, other: i16)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<i32> for usize
impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
fn shl_assign(&mut self, other: i32)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<i64> for usize
impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
fn shl_assign(&mut self, other: i64)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<i8> for usize
impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
fn shl_assign(&mut self, other: i8)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<isize> for usize
impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
fn shl_assign(&mut self, other: isize)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<u128> for usize
impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
fn shl_assign(&mut self, other: u128)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<u16> for usize
impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
fn shl_assign(&mut self, other: u16)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<u32> for usize
impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
fn shl_assign(&mut self, other: u32)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<u64> for usize
impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
fn shl_assign(&mut self, other: u64)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<u8> for usize
impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
fn shl_assign(&mut self, other: u8)
<<=
operation. Read more1.8.0 · source§impl ShlAssign for usize
impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
fn shl_assign(&mut self, other: usize)
<<=
operation. Read more1.22.0 · source§impl ShrAssign<&i128> for usize
impl ShrAssign<&i128> for usize
source§fn shr_assign(&mut self, other: &i128)
fn shr_assign(&mut self, other: &i128)
>>=
operation. Read more1.22.0 · source§impl ShrAssign<&i16> for usize
impl ShrAssign<&i16> for usize
source§fn shr_assign(&mut self, other: &i16)
fn shr_assign(&mut self, other: &i16)
>>=
operation. Read more1.22.0 · source§impl ShrAssign<&i32> for usize
impl ShrAssign<&i32> for usize
source§fn shr_assign(&mut self, other: &i32)
fn shr_assign(&mut self, other: &i32)
>>=
operation. Read more1.22.0 · source§impl ShrAssign<&i64> for usize
impl ShrAssign<&i64> for usize
source§fn shr_assign(&mut self, other: &i64)
fn shr_assign(&mut self, other: &i64)
>>=
operation. Read more1.22.0 · source§impl ShrAssign<&i8> for usize
impl ShrAssign<&i8> for usize
source§fn shr_assign(&mut self, other: &i8)
fn shr_assign(&mut self, other: &i8)
>>=
operation. Read more1.22.0 · source§impl ShrAssign<&isize> for usize
impl ShrAssign<&isize> for usize
source§fn shr_assign(&mut self, other: &isize)
fn shr_assign(&mut self, other: &isize)
>>=
operation. Read more1.22.0 · source§impl ShrAssign<&u128> for usize
impl ShrAssign<&u128> for usize
source§fn shr_assign(&mut self, other: &u128)
fn shr_assign(&mut self, other: &u128)
>>=
operation. Read more1.22.0 · source§impl ShrAssign<&u16> for usize
impl ShrAssign<&u16> for usize
source§fn shr_assign(&mut self, other: &u16)
fn shr_assign(&mut self, other: &u16)
>>=
operation. Read more1.22.0 · source§impl ShrAssign<&u32> for usize
impl ShrAssign<&u32> for usize
source§fn shr_assign(&mut self, other: &u32)
fn shr_assign(&mut self, other: &u32)
>>=
operation. Read more1.22.0 · source§impl ShrAssign<&u64> for usize
impl ShrAssign<&u64> for usize
source§fn shr_assign(&mut self, other: &u64)
fn shr_assign(&mut self, other: &u64)
>>=
operation. Read more1.22.0 · source§impl ShrAssign<&u8> for usize
impl ShrAssign<&u8> for usize
source§fn shr_assign(&mut self, other: &u8)
fn shr_assign(&mut self, other: &u8)
>>=
operation. Read more1.22.0 · source§impl ShrAssign<&usize> for usize
impl ShrAssign<&usize> for usize
source§fn shr_assign(&mut self, other: &usize)
fn shr_assign(&mut self, other: &usize)
>>=
operation. Read more1.8.0 · source§impl ShrAssign<i128> for usize
impl ShrAssign<i128> for usize
source§fn shr_assign(&mut self, other: i128)
fn shr_assign(&mut self, other: i128)
>>=
operation. Read more1.8.0 · source§impl ShrAssign<i16> for usize
impl ShrAssign<i16> for usize
source§fn shr_assign(&mut self, other: i16)
fn shr_assign(&mut self, other: i16)
>>=
operation. Read more1.8.0 · source§impl ShrAssign<i32> for usize
impl ShrAssign<i32> for usize
source§fn shr_assign(&mut self, other: i32)
fn shr_assign(&mut self, other: i32)
>>=
operation. Read more1.8.0 · source§impl ShrAssign<i64> for usize
impl ShrAssign<i64> for usize
source§fn shr_assign(&mut self, other: i64)
fn shr_assign(&mut self, other: i64)
>>=
operation. Read more1.8.0 · source§impl ShrAssign<i8> for usize
impl ShrAssign<i8> for usize
source§fn shr_assign(&mut self, other: i8)
fn shr_assign(&mut self, other: i8)
>>=
operation. Read more1.8.0 · source§impl ShrAssign<isize> for usize
impl ShrAssign<isize> for usize
source§fn shr_assign(&mut self, other: isize)
fn shr_assign(&mut self, other: isize)
>>=
operation. Read more1.8.0 · source§impl ShrAssign<u128> for usize
impl ShrAssign<u128> for usize
source§fn shr_assign(&mut self, other: u128)
fn shr_assign(&mut self, other: u128)
>>=
operation. Read more1.8.0 · source§impl ShrAssign<u16> for usize
impl ShrAssign<u16> for usize
source§fn shr_assign(&mut self, other: u16)
fn shr_assign(&mut self, other: u16)
>>=
operation. Read more1.8.0 · source§impl ShrAssign<u32> for usize
impl ShrAssign<u32> for usize
source§fn shr_assign(&mut self, other: u32)
fn shr_assign(&mut self, other: u32)
>>=
operation. Read more1.8.0 · source§impl ShrAssign<u64> for usize
impl ShrAssign<u64> for usize
source§fn shr_assign(&mut self, other: u64)
fn shr_assign(&mut self, other: u64)
>>=
operation. Read more1.8.0 · source§impl ShrAssign<u8> for usize
impl ShrAssign<u8> for usize
source§fn shr_assign(&mut self, other: u8)
fn shr_assign(&mut self, other: u8)
>>=
operation. Read more1.8.0 · source§impl ShrAssign for usize
impl ShrAssign for usize
source§fn shr_assign(&mut self, other: usize)
fn shr_assign(&mut self, other: usize)
>>=
operation. Read moresource§impl SimdElement for usize
impl SimdElement for usize
1.15.0 (const: unstable) · source§impl<T> SliceIndex<[T]> for usize
impl<T> SliceIndex<[T]> for usize
The methods index
and index_mut
panic if the index is out of bounds.
source§fn get(self, slice: &[T]) -> Option<&T>
fn get(self, slice: &[T]) -> Option<&T>
slice_index_methods
)source§fn get_mut(self, slice: &mut [T]) -> Option<&mut T>
fn get_mut(self, slice: &mut [T]) -> Option<&mut T>
slice_index_methods
)source§unsafe fn get_unchecked(self, slice: *const [T]) -> *const T
unsafe fn get_unchecked(self, slice: *const [T]) -> *const T
slice_index_methods
)slice
pointer\nis undefined behavior even if the resulting pointer is not used.source§unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut T
unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut T
slice_index_methods
)slice
pointer\nis undefined behavior even if the resulting pointer is not used.§impl SmartDisplay for usize
impl SmartDisplay for usize
§fn metadata(&self, f: FormatterOptions) -> Metadata<'_, usize>
fn metadata(&self, f: FormatterOptions) -> Metadata<'_, usize>
§fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Display::fmt
. Read more§fn fmt_with_metadata(\n &self,\n f: &mut Formatter<'_>,\n _metadata: Metadata<'_, Self>,\n) -> Result<(), Error>
fn fmt_with_metadata(\n &self,\n f: &mut Formatter<'_>,\n _metadata: Metadata<'_, Self>,\n) -> Result<(), Error>
source§impl Step for usize
impl Step for usize
source§fn forward(start: usize, n: usize) -> usize
fn forward(start: usize, n: usize) -> usize
step_trait
)source§fn backward(start: usize, n: usize) -> usize
fn backward(start: usize, n: usize) -> usize
step_trait
)source§unsafe fn forward_unchecked(start: usize, n: usize) -> usize
unsafe fn forward_unchecked(start: usize, n: usize) -> usize
step_trait
)source§unsafe fn backward_unchecked(start: usize, n: usize) -> usize
unsafe fn backward_unchecked(start: usize, n: usize) -> usize
step_trait
)source§fn steps_between(start: &usize, end: &usize) -> Option<usize>
fn steps_between(start: &usize, end: &usize) -> Option<usize>
step_trait
)1.22.0 · source§impl SubAssign<&usize> for usize
impl SubAssign<&usize> for usize
source§fn sub_assign(&mut self, other: &usize)
fn sub_assign(&mut self, other: &usize)
-=
operation. Read more1.8.0 · source§impl SubAssign for usize
impl SubAssign for usize
source§fn sub_assign(&mut self, other: usize)
fn sub_assign(&mut self, other: usize)
-=
operation. Read moresource§impl ToBigUint for usize
impl ToBigUint for usize
source§fn to_biguint(&self) -> Option<BigUint>
fn to_biguint(&self) -> Option<BigUint>
self
to a BigUint
.source§impl ToBytes for usize
impl ToBytes for usize
type Bytes = [u8; 8]
source§fn to_be_bytes(&self) -> <usize as ToBytes>::Bytes
fn to_be_bytes(&self) -> <usize as ToBytes>::Bytes
source§impl ToPrimitive for usize
impl ToPrimitive for usize
source§fn to_isize(&self) -> Option<isize>
fn to_isize(&self) -> Option<isize>
self
to an isize
. If the value cannot be\nrepresented by an isize
, then None
is returned.source§fn to_i8(&self) -> Option<i8>
fn to_i8(&self) -> Option<i8>
self
to an i8
. If the value cannot be\nrepresented by an i8
, then None
is returned.source§fn to_i16(&self) -> Option<i16>
fn to_i16(&self) -> Option<i16>
self
to an i16
. If the value cannot be\nrepresented by an i16
, then None
is returned.source§fn to_i32(&self) -> Option<i32>
fn to_i32(&self) -> Option<i32>
self
to an i32
. If the value cannot be\nrepresented by an i32
, then None
is returned.source§fn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
self
to an i64
. If the value cannot be\nrepresented by an i64
, then None
is returned.source§fn to_i128(&self) -> Option<i128>
fn to_i128(&self) -> Option<i128>
self
to an i128
. If the value cannot be\nrepresented by an i128
(i64
under the default implementation), then\nNone
is returned. Read moresource§fn to_usize(&self) -> Option<usize>
fn to_usize(&self) -> Option<usize>
self
to a usize
. If the value cannot be\nrepresented by a usize
, then None
is returned.source§fn to_u8(&self) -> Option<u8>
fn to_u8(&self) -> Option<u8>
self
to a u8
. If the value cannot be\nrepresented by a u8
, then None
is returned.source§fn to_u16(&self) -> Option<u16>
fn to_u16(&self) -> Option<u16>
self
to a u16
. If the value cannot be\nrepresented by a u16
, then None
is returned.source§fn to_u32(&self) -> Option<u32>
fn to_u32(&self) -> Option<u32>
self
to a u32
. If the value cannot be\nrepresented by a u32
, then None
is returned.source§fn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
self
to a u64
. If the value cannot be\nrepresented by a u64
, then None
is returned.source§fn to_u128(&self) -> Option<u128>
fn to_u128(&self) -> Option<u128>
self
to a u128
. If the value cannot be\nrepresented by a u128
(u64
under the default implementation), then\nNone
is returned. Read more1.34.0 · source§impl TryFrom<i128> for usize
impl TryFrom<i128> for usize
source§fn try_from(u: i128) -> Result<usize, <usize as TryFrom<i128>>::Error>
fn try_from(u: i128) -> Result<usize, <usize as TryFrom<i128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
type Error = TryFromIntError
1.34.0 · source§impl TryFrom<i16> for usize
impl TryFrom<i16> for usize
source§fn try_from(u: i16) -> Result<usize, <usize as TryFrom<i16>>::Error>
fn try_from(u: i16) -> Result<usize, <usize as TryFrom<i16>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
type Error = TryFromIntError
1.34.0 · source§impl TryFrom<i32> for usize
impl TryFrom<i32> for usize
source§fn try_from(u: i32) -> Result<usize, <usize as TryFrom<i32>>::Error>
fn try_from(u: i32) -> Result<usize, <usize as TryFrom<i32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
type Error = TryFromIntError
1.34.0 · source§impl TryFrom<i64> for usize
impl TryFrom<i64> for usize
source§fn try_from(u: i64) -> Result<usize, <usize as TryFrom<i64>>::Error>
fn try_from(u: i64) -> Result<usize, <usize as TryFrom<i64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
type Error = TryFromIntError
1.34.0 · source§impl TryFrom<i8> for usize
impl TryFrom<i8> for usize
source§fn try_from(u: i8) -> Result<usize, <usize as TryFrom<i8>>::Error>
fn try_from(u: i8) -> Result<usize, <usize as TryFrom<i8>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
type Error = TryFromIntError
1.34.0 · source§impl TryFrom<isize> for usize
impl TryFrom<isize> for usize
source§fn try_from(u: isize) -> Result<usize, <usize as TryFrom<isize>>::Error>
fn try_from(u: isize) -> Result<usize, <usize as TryFrom<isize>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
type Error = TryFromIntError
1.34.0 · source§impl TryFrom<u128> for usize
impl TryFrom<u128> for usize
source§fn try_from(u: u128) -> Result<usize, <usize as TryFrom<u128>>::Error>
fn try_from(u: u128) -> Result<usize, <usize as TryFrom<u128>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
type Error = TryFromIntError
1.34.0 · source§impl TryFrom<u32> for usize
impl TryFrom<u32> for usize
source§fn try_from(value: u32) -> Result<usize, <usize as TryFrom<u32>>::Error>
fn try_from(value: u32) -> Result<usize, <usize as TryFrom<u32>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
type Error = TryFromIntError
1.34.0 · source§impl TryFrom<u64> for usize
impl TryFrom<u64> for usize
source§fn try_from(value: u64) -> Result<usize, <usize as TryFrom<u64>>::Error>
fn try_from(value: u64) -> Result<usize, <usize as TryFrom<u64>>::Error>
Try to create the target number type from a source\nnumber type. This returns an error if the source value\nis outside of the range of the target type.
\n§type Error = TryFromIntError
type Error = TryFromIntError
§impl Unsigned for usize
impl Unsigned for usize
§fn is_power_of_two(self) -> bool
fn is_power_of_two(self) -> bool
true
if and only if self == 2^k
for some k
.§fn next_power_of_two(self) -> usize
fn next_power_of_two(self) -> usize
self
. Read more§fn checked_next_power_of_two(self) -> Option<usize>
fn checked_next_power_of_two(self) -> Option<usize>
n
. If the\nnext power of two is greater than the type’s maximum value, None
is\nreturned, otherwise the power of two is wrapped in Some
.source§impl WrappingAdd for usize
impl WrappingAdd for usize
source§fn wrapping_add(&self, v: &usize) -> usize
fn wrapping_add(&self, v: &usize) -> usize
self + other
, wrapping around at the boundary of\nthe type.source§impl WrappingMul for usize
impl WrappingMul for usize
source§fn wrapping_mul(&self, v: &usize) -> usize
fn wrapping_mul(&self, v: &usize) -> usize
self * other
, wrapping around at the boundary\nof the type.source§impl WrappingNeg for usize
impl WrappingNeg for usize
source§fn wrapping_neg(&self) -> usize
fn wrapping_neg(&self) -> usize
-self
,\nwrapping around at the boundary of the type. Read moresource§impl WrappingShl for usize
impl WrappingShl for usize
source§impl WrappingShr for usize
impl WrappingShr for usize
source§impl WrappingSub for usize
impl WrappingSub for usize
source§fn wrapping_sub(&self, v: &usize) -> usize
fn wrapping_sub(&self, v: &usize) -> usize
self - other
, wrapping around at the boundary\nof the type.§impl Writeable for usize
impl Writeable for usize
§fn write_to<W>(&self, sink: &mut W) -> Result<(), Error>
fn write_to<W>(&self, sink: &mut W) -> Result<(), Error>
write_to_parts
, and discards any\nPart
annotations.§fn writeable_length_hint(&self) -> LengthHint
fn writeable_length_hint(&self) -> LengthHint
§fn write_to_parts<S>(&self, sink: &mut S) -> Result<(), Error>where\n S: PartsWrite + ?Sized,
fn write_to_parts<S>(&self, sink: &mut S) -> Result<(), Error>where\n S: PartsWrite + ?Sized,
Part
annotations to the given sink. Errors from the\nsink are bubbled up. The default implementation delegates to write_to
,\nand doesn’t produce any Part
annotations.§fn write_to_string(&self) -> Cow<'_, str>
fn write_to_string(&self) -> Cow<'_, str>
String
with the data from this Writeable
. Like ToString
,\nbut smaller and faster. Read more§fn writeable_cmp_bytes(&self, other: &[u8]) -> Ordering
fn writeable_cmp_bytes(&self, other: &[u8]) -> Ordering
Writeable
to the given bytes\nwithout allocating a String to hold the Writeable
contents. Read more§impl<'a> Yokeable<'a> for usize
impl<'a> Yokeable<'a> for usize
§fn transform_owned(self) -> <usize as Yokeable<'a>>::Output
fn transform_owned(self) -> <usize as Yokeable<'a>>::Output
§unsafe fn make(this: <usize as Yokeable<'a>>::Output) -> usize
unsafe fn make(this: <usize as Yokeable<'a>>::Output) -> usize
Self<'a>
’s lifetime. Read more§fn transform_mut<F>(&'a mut self, f: F)
fn transform_mut<F>(&'a mut self, f: F)
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,\nand pass it to f
. Read more§impl<'a> ZeroMapKV<'a> for usize
impl<'a> ZeroMapKV<'a> for usize
source§impl usize
impl usize
1.43.0 · sourcepub const MIN: usize = 0usize
pub const MIN: usize = 0usize
The smallest value that can be represented by this integer type.
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MIN, 0);
1.43.0 · sourcepub const MAX: usize = 18_446_744_073_709_551_615usize
pub const MAX: usize = 18_446_744_073_709_551_615usize
The largest value that can be represented by this integer type\n(264 − 1 on 64-bit targets).
\n§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX, 18446744073709551615);
1.0.0 (const: 1.32.0) · sourcepub const fn count_ones(self) -> u32
pub const fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self
.
§Examples
\nBasic usage:
\n\nlet n = 0b01001100usize;\n\nassert_eq!(n.count_ones(), 3);
1.0.0 (const: 1.32.0) · sourcepub const fn count_zeros(self) -> u32
pub const fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self
.
§Examples
\nBasic usage:
\n\nassert_eq!(usize::MAX.count_zeros(), 0);
1.0.0 (const: 1.32.0) · sourcepub const fn leading_zeros(self) -> u32
pub const fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of self
.
Depending on what you’re doing with the value, you might also be interested in the\nilog2
function which returns a consistent number, even if the type widens.
§Examples
\nBasic usage:
\n\nlet n = usize::MAX >> 2;\n\nassert_eq!(n.leading_zeros(), 2);
1.0.0 (const: 1.32.0) · sourcepub const fn trailing_zeros(self) -> u32
pub const fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation\nof self
.
§Examples
\nBasic usage:
\n\nlet n = 0b0101000usize;\n\nassert_eq!(n.trailing_zeros(), 3);
1.46.0 (const: 1.46.0) · sourcepub const fn leading_ones(self) -> u32
pub const fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of self
.
§Examples
\nBasic usage:
\n\nlet n = !(usize::MAX >> 2);\n\nassert_eq!(n.leading_ones(), 2);
1.46.0 (const: 1.46.0) · sourcepub const fn trailing_ones(self) -> u32
pub const fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation\nof self
.
§Examples
\nBasic usage:
\n\nlet n = 0b1010111usize;\n\nassert_eq!(n.trailing_ones(), 3);
sourcepub const fn cast_signed(self) -> isize
🔬This is a nightly-only experimental API. (integer_sign_cast
)
pub const fn cast_signed(self) -> isize
integer_sign_cast
)Returns the bit pattern of self
reinterpreted as a signed integer of the same size.
This produces the same result as an as
cast, but ensures that the bit-width remains\nthe same.
§Examples
\nBasic usage:
\n\n#![feature(integer_sign_cast)]\n\nlet n = usize::MAX;\n\nassert_eq!(n.cast_signed(), -1isize);
1.0.0 (const: 1.32.0) · sourcepub const fn rotate_left(self, n: u32) -> usize
pub const fn rotate_left(self, n: u32) -> usize
Shifts the bits to the left by a specified amount, n
,\nwrapping the truncated bits to the end of the resulting integer.
Please note this isn’t the same operation as the <<
shifting operator!
§Examples
\nBasic usage:
\n\nlet n = 0xaa00000000006e1usize;\nlet m = 0x6e10aa;\n\nassert_eq!(n.rotate_left(12), m);
1.0.0 (const: 1.32.0) · sourcepub const fn rotate_right(self, n: u32) -> usize
pub const fn rotate_right(self, n: u32) -> usize
Shifts the bits to the right by a specified amount, n
,\nwrapping the truncated bits to the beginning of the resulting\ninteger.
Please note this isn’t the same operation as the >>
shifting operator!
§Examples
\nBasic usage:
\n\nlet n = 0x6e10aausize;\nlet m = 0xaa00000000006e1;\n\nassert_eq!(n.rotate_right(12), m);
1.0.0 (const: 1.32.0) · sourcepub const fn swap_bytes(self) -> usize
pub const fn swap_bytes(self) -> usize
Reverses the byte order of the integer.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.swap_bytes();\n\nassert_eq!(m, 0x5634129078563412);
1.37.0 (const: 1.37.0) · sourcepub const fn reverse_bits(self) -> usize
pub const fn reverse_bits(self) -> usize
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit,\nsecond least-significant bit becomes second most-significant bit, etc.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1234567890123456usize;\nlet m = n.reverse_bits();\n\nassert_eq!(m, 0x6a2c48091e6a2c48);\nassert_eq!(0, 0usize.reverse_bits());
1.0.0 (const: 1.32.0) · sourcepub const fn from_be(x: usize) -> usize
pub const fn from_be(x: usize) -> usize
Converts an integer from big endian to the target’s endianness.
\nOn big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(usize::from_be(n), n)\n} else {\n assert_eq!(usize::from_be(n), n.swap_bytes())\n}
1.0.0 (const: 1.32.0) · sourcepub const fn from_le(x: usize) -> usize
pub const fn from_le(x: usize) -> usize
Converts an integer from little endian to the target’s endianness.
\nOn little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(usize::from_le(n), n)\n} else {\n assert_eq!(usize::from_le(n), n.swap_bytes())\n}
1.0.0 (const: 1.32.0) · sourcepub const fn to_be(self) -> usize
pub const fn to_be(self) -> usize
Converts self
to big endian from the target’s endianness.
On big endian this is a no-op. On little endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"big\") {\n assert_eq!(n.to_be(), n)\n} else {\n assert_eq!(n.to_be(), n.swap_bytes())\n}
1.0.0 (const: 1.32.0) · sourcepub const fn to_le(self) -> usize
pub const fn to_le(self) -> usize
Converts self
to little endian from the target’s endianness.
On little endian this is a no-op. On big endian the bytes are\nswapped.
\n§Examples
\nBasic usage:
\n\nlet n = 0x1Ausize;\n\nif cfg!(target_endian = \"little\") {\n assert_eq!(n.to_le(), n)\n} else {\n assert_eq!(n.to_le(), n.swap_bytes())\n}
1.0.0 (const: 1.47.0) · sourcepub const fn checked_add(self, rhs: usize) -> Option<usize>
pub const fn checked_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes self + rhs
, returning None
\nif overflow occurred.
§Examples
\nBasic usage:
\n\nassert_eq!((usize::MAX - 2).checked_add(1), Some(usize::MAX - 1));\nassert_eq!((usize::MAX - 2).checked_add(3), None);
sourcepub const fn strict_add(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
pub const fn strict_add(self, rhs: usize) -> usize
strict_overflow_ops
)Strict integer addition. Computes self + rhs
, panicking\nif overflow occurred.
§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!((usize::MAX - 2).strict_add(1), usize::MAX - 1);
The following panics because of overflow:
\n\n#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add(3);
1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_add(self, rhs: usize) -> usize
pub const unsafe fn unchecked_add(self, rhs: usize) -> usize
Unchecked integer addition. Computes self + rhs
, assuming overflow\ncannot occur.
Calling x.unchecked_add(y)
is semantically equivalent to calling\nx.
checked_add
(y).
unwrap_unchecked
()
.
If you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_add
.
§Safety
\nThis results in undefined behavior when\nself + rhs > usize::MAX
or self + rhs < usize::MIN
,\ni.e. when checked_add
would return None
.
1.66.0 (const: 1.66.0) · sourcepub const fn checked_add_signed(self, rhs: isize) -> Option<usize>
pub const fn checked_add_signed(self, rhs: isize) -> Option<usize>
Checked addition with a signed integer. Computes self + rhs
,\nreturning None
if overflow occurred.
§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_add_signed(2), Some(3));\nassert_eq!(1usize.checked_add_signed(-2), None);\nassert_eq!((usize::MAX - 2).checked_add_signed(3), None);
sourcepub const fn strict_add_signed(self, rhs: isize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
pub const fn strict_add_signed(self, rhs: isize) -> usize
strict_overflow_ops
)Strict addition with a signed integer. Computes self + rhs
,\npanicking if overflow occurred.
§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_add_signed(2), 3);
The following panic because of overflow:
\n\n#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_add_signed(-2);
#![feature(strict_overflow_ops)]\nlet _ = (usize::MAX - 2).strict_add_signed(3);
1.0.0 (const: 1.47.0) · sourcepub const fn checked_sub(self, rhs: usize) -> Option<usize>
pub const fn checked_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes self - rhs
, returning\nNone
if overflow occurred.
§Examples
\nBasic usage:
\n\nassert_eq!(1usize.checked_sub(1), Some(0));\nassert_eq!(0usize.checked_sub(1), None);
sourcepub const fn strict_sub(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
pub const fn strict_sub(self, rhs: usize) -> usize
strict_overflow_ops
)Strict integer subtraction. Computes self - rhs
, panicking if\noverflow occurred.
§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(1usize.strict_sub(1), 0);
The following panics because of overflow:
\n\n#![feature(strict_overflow_ops)]\nlet _ = 0usize.strict_sub(1);
1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_sub(self, rhs: usize) -> usize
pub const unsafe fn unchecked_sub(self, rhs: usize) -> usize
Unchecked integer subtraction. Computes self - rhs
, assuming overflow\ncannot occur.
Calling x.unchecked_sub(y)
is semantically equivalent to calling\nx.
checked_sub
(y).
unwrap_unchecked
()
.
If you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_sub
.
If you find yourself writing code like this:
\n\nif foo >= bar {\n // SAFETY: just checked it will not overflow\n let diff = unsafe { foo.unchecked_sub(bar) };\n // ... use diff ...\n}
Consider changing it to
\n\nif let Some(diff) = foo.checked_sub(bar) {\n // ... use diff ...\n}
As that does exactly the same thing – including telling the optimizer\nthat the subtraction cannot overflow – but avoids needing unsafe
.
§Safety
\nThis results in undefined behavior when\nself - rhs > usize::MAX
or self - rhs < usize::MIN
,\ni.e. when checked_sub
would return None
.
1.0.0 (const: 1.47.0) · sourcepub const fn checked_mul(self, rhs: usize) -> Option<usize>
pub const fn checked_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes self * rhs
, returning\nNone
if overflow occurred.
§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_mul(1), Some(5));\nassert_eq!(usize::MAX.checked_mul(2), None);
sourcepub const fn strict_mul(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
pub const fn strict_mul(self, rhs: usize) -> usize
strict_overflow_ops
)Strict integer multiplication. Computes self * rhs
, panicking if\noverflow occurred.
§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(5usize.strict_mul(1), 5);
The following panics because of overflow:
\n\n#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_mul(2);
1.79.0 (const: 1.79.0) · sourcepub const unsafe fn unchecked_mul(self, rhs: usize) -> usize
pub const unsafe fn unchecked_mul(self, rhs: usize) -> usize
Unchecked integer multiplication. Computes self * rhs
, assuming overflow\ncannot occur.
Calling x.unchecked_mul(y)
is semantically equivalent to calling\nx.
checked_mul
(y).
unwrap_unchecked
()
.
If you’re just trying to avoid the panic in debug mode, then do not\nuse this. Instead, you’re looking for wrapping_mul
.
§Safety
\nThis results in undefined behavior when\nself * rhs > usize::MAX
or self * rhs < usize::MIN
,\ni.e. when checked_mul
would return None
.
1.0.0 (const: 1.52.0) · sourcepub const fn checked_div(self, rhs: usize) -> Option<usize>
pub const fn checked_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes self / rhs
, returning None
\nif rhs == 0
.
§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div(2), Some(64));\nassert_eq!(1usize.checked_div(0), None);
sourcepub const fn strict_div(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
pub const fn strict_div(self, rhs: usize) -> usize
strict_overflow_ops
)Strict integer division. Computes self / rhs
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
§Panics
\nThis function will panic if rhs
is zero.
§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div(10), 10);
The following panics because of division by zero:
\n\n#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div(0);
1.38.0 (const: 1.52.0) · sourcepub const fn checked_div_euclid(self, rhs: usize) -> Option<usize>
pub const fn checked_div_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes self.div_euclid(rhs)
, returning None
\nif rhs == 0
.
§Examples
\nBasic usage:
\n\nassert_eq!(128usize.checked_div_euclid(2), Some(64));\nassert_eq!(1usize.checked_div_euclid(0), None);
sourcepub const fn strict_div_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
pub const fn strict_div_euclid(self, rhs: usize) -> usize
strict_overflow_ops
)Strict Euclidean division. Computes self.div_euclid(rhs)
.\nStrict division on unsigned types is just normal division.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_div(rhs)
.
§Panics
\nThis function will panic if rhs
is zero.
§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_div_euclid(10), 10);
The following panics because of division by zero:
\n\n#![feature(strict_overflow_ops)]\nlet _ = (1usize).strict_div_euclid(0);
1.7.0 (const: 1.52.0) · sourcepub const fn checked_rem(self, rhs: usize) -> Option<usize>
pub const fn checked_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes self % rhs
, returning None
\nif rhs == 0
.
§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem(2), Some(1));\nassert_eq!(5usize.checked_rem(0), None);
sourcepub const fn strict_rem(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
pub const fn strict_rem(self, rhs: usize) -> usize
strict_overflow_ops
)Strict integer remainder. Computes self % rhs
.\nStrict remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.
§Panics
\nThis function will panic if rhs
is zero.
§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem(10), 0);
The following panics because of division by zero:
\n\n#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem(0);
1.38.0 (const: 1.52.0) · sourcepub const fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
pub const fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean modulo. Computes self.rem_euclid(rhs)
, returning None
\nif rhs == 0
.
§Examples
\nBasic usage:
\n\nassert_eq!(5usize.checked_rem_euclid(2), Some(1));\nassert_eq!(5usize.checked_rem_euclid(0), None);
sourcepub const fn strict_rem_euclid(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
pub const fn strict_rem_euclid(self, rhs: usize) -> usize
strict_overflow_ops
)Strict Euclidean modulo. Computes self.rem_euclid(rhs)
.\nStrict modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way overflow could ever happen.\nThis function exists, so that all operations\nare accounted for in the strict operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.strict_rem(rhs)
.
§Panics
\nThis function will panic if rhs
is zero.
§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(100usize.strict_rem_euclid(10), 0);
The following panics because of division by zero:
\n\n#![feature(strict_overflow_ops)]\nlet _ = 5usize.strict_rem_euclid(0);
1.67.0 (const: 1.67.0) · sourcepub const fn ilog(self, base: usize) -> u32
pub const fn ilog(self, base: usize) -> u32
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nThis method might not be optimized owing to implementation details;\nilog2
can produce results more efficiently for base 2, and ilog10
\ncan produce results more efficiently for base 10.
§Panics
\nThis function will panic if self
is zero, or if base
is less than 2.
§Examples
\nassert_eq!(5usize.ilog(5), 1);
1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog(self, base: usize) -> Option<u32>
pub const fn checked_ilog(self, base: usize) -> Option<u32>
Returns the logarithm of the number with respect to an arbitrary base,\nrounded down.
\nReturns None
if the number is zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details;\nchecked_ilog2
can produce results more efficiently for base 2, and\nchecked_ilog10
can produce results more efficiently for base 10.
§Examples
\nassert_eq!(5usize.checked_ilog(5), Some(1));
1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog2(self) -> Option<u32>
pub const fn checked_ilog2(self) -> Option<u32>
Returns the base 2 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
§Examples
\nassert_eq!(2usize.checked_ilog2(), Some(1));
1.67.0 (const: 1.67.0) · sourcepub const fn checked_ilog10(self) -> Option<u32>
pub const fn checked_ilog10(self) -> Option<u32>
Returns the base 10 logarithm of the number, rounded down.
\nReturns None
if the number is zero.
§Examples
\nassert_eq!(10usize.checked_ilog10(), Some(1));
1.7.0 (const: 1.47.0) · sourcepub const fn checked_neg(self) -> Option<usize>
pub const fn checked_neg(self) -> Option<usize>
Checked negation. Computes -self
, returning None
unless self == 0
.
Note that negating any positive integer will overflow.
\n§Examples
\nBasic usage:
\n\nassert_eq!(0usize.checked_neg(), Some(0));\nassert_eq!(1usize.checked_neg(), None);
sourcepub const fn strict_neg(self) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
pub const fn strict_neg(self) -> usize
strict_overflow_ops
)Strict negation. Computes -self
, panicking unless self == 0
.
Note that negating any positive integer will overflow.
\n§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0usize.strict_neg(), 0);
The following panics because of overflow:
\n\n#![feature(strict_overflow_ops)]\nlet _ = 1usize.strict_neg();
1.7.0 (const: 1.47.0) · sourcepub const fn checked_shl(self, rhs: u32) -> Option<usize>
pub const fn checked_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes self << rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
§Examples
\nBasic usage:
\n\nassert_eq!(0x1usize.checked_shl(4), Some(0x10));\nassert_eq!(0x10usize.checked_shl(129), None);
sourcepub const fn strict_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
pub const fn strict_shl(self, rhs: u32) -> usize
strict_overflow_ops
)Strict shift left. Computes self << rhs
, panicking if rhs
is larger\nthan or equal to the number of bits in self
.
§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x1usize.strict_shl(4), 0x10);
The following panics because of overflow:
\n\n#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shl(129);
sourcepub const unsafe fn unchecked_shl(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
pub const unsafe fn unchecked_shl(self, rhs: u32) -> usize
unchecked_shifts
)Unchecked shift left. Computes self << rhs
, assuming that\nrhs
is less than the number of bits in self
.
§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shl
would return None
.
1.7.0 (const: 1.47.0) · sourcepub const fn checked_shr(self, rhs: u32) -> Option<usize>
pub const fn checked_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes self >> rhs
, returning None
\nif rhs
is larger than or equal to the number of bits in self
.
§Examples
\nBasic usage:
\n\nassert_eq!(0x10usize.checked_shr(4), Some(0x1));\nassert_eq!(0x10usize.checked_shr(129), None);
sourcepub const fn strict_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
pub const fn strict_shr(self, rhs: u32) -> usize
strict_overflow_ops
)Strict shift right. Computes self >> rhs
, panicking rhs
is\nlarger than or equal to the number of bits in self
.
§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(0x10usize.strict_shr(4), 0x1);
The following panics because of overflow:
\n\n#![feature(strict_overflow_ops)]\nlet _ = 0x10usize.strict_shr(129);
sourcepub const unsafe fn unchecked_shr(self, rhs: u32) -> usize
🔬This is a nightly-only experimental API. (unchecked_shifts
)
pub const unsafe fn unchecked_shr(self, rhs: u32) -> usize
unchecked_shifts
)Unchecked shift right. Computes self >> rhs
, assuming that\nrhs
is less than the number of bits in self
.
§Safety
\nThis results in undefined behavior if rhs
is larger than\nor equal to the number of bits in self
,\ni.e. when checked_shr
would return None
.
1.34.0 (const: 1.50.0) · sourcepub const fn checked_pow(self, exp: u32) -> Option<usize>
pub const fn checked_pow(self, exp: u32) -> Option<usize>
Checked exponentiation. Computes self.pow(exp)
, returning None
if\noverflow occurred.
§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_pow(5), Some(32));\nassert_eq!(usize::MAX.checked_pow(2), None);
sourcepub const fn strict_pow(self, exp: u32) -> usize
🔬This is a nightly-only experimental API. (strict_overflow_ops
)
pub const fn strict_pow(self, exp: u32) -> usize
strict_overflow_ops
)Strict exponentiation. Computes self.pow(exp)
, panicking if\noverflow occurred.
§Panics
§Overflow behavior
\nThis function will always panic on overflow, regardless of whether overflow checks are enabled.
\n§Examples
\nBasic usage:
\n\n#![feature(strict_overflow_ops)]\nassert_eq!(2usize.strict_pow(5), 32);
The following panics because of overflow:
\n\n#![feature(strict_overflow_ops)]\nlet _ = usize::MAX.strict_pow(2);
1.0.0 (const: 1.47.0) · sourcepub const fn saturating_add(self, rhs: usize) -> usize
pub const fn saturating_add(self, rhs: usize) -> usize
Saturating integer addition. Computes self + rhs
, saturating at\nthe numeric bounds instead of overflowing.
§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_add(1), 101);\nassert_eq!(usize::MAX.saturating_add(127), usize::MAX);
1.66.0 (const: 1.66.0) · sourcepub const fn saturating_add_signed(self, rhs: isize) -> usize
pub const fn saturating_add_signed(self, rhs: isize) -> usize
Saturating addition with a signed integer. Computes self + rhs
,\nsaturating at the numeric bounds instead of overflowing.
§Examples
\nBasic usage:
\n\nassert_eq!(1usize.saturating_add_signed(2), 3);\nassert_eq!(1usize.saturating_add_signed(-2), 0);\nassert_eq!((usize::MAX - 2).saturating_add_signed(4), usize::MAX);
1.0.0 (const: 1.47.0) · sourcepub const fn saturating_sub(self, rhs: usize) -> usize
pub const fn saturating_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes self - rhs
, saturating\nat the numeric bounds instead of overflowing.
§Examples
\nBasic usage:
\n\nassert_eq!(100usize.saturating_sub(27), 73);\nassert_eq!(13usize.saturating_sub(127), 0);
1.7.0 (const: 1.47.0) · sourcepub const fn saturating_mul(self, rhs: usize) -> usize
pub const fn saturating_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes self * rhs
,\nsaturating at the numeric bounds instead of overflowing.
§Examples
\nBasic usage:
\n\nassert_eq!(2usize.saturating_mul(10), 20);\nassert_eq!((usize::MAX).saturating_mul(10), usize::MAX);
1.58.0 (const: 1.58.0) · sourcepub const fn saturating_div(self, rhs: usize) -> usize
pub const fn saturating_div(self, rhs: usize) -> usize
1.34.0 (const: 1.50.0) · sourcepub const fn saturating_pow(self, exp: u32) -> usize
pub const fn saturating_pow(self, exp: u32) -> usize
Saturating integer exponentiation. Computes self.pow(exp)
,\nsaturating at the numeric bounds instead of overflowing.
§Examples
\nBasic usage:
\n\nassert_eq!(4usize.saturating_pow(3), 64);\nassert_eq!(usize::MAX.saturating_pow(2), usize::MAX);
1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_add(self, rhs: usize) -> usize
pub const fn wrapping_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes self + rhs
,\nwrapping around at the boundary of the type.
§Examples
\nBasic usage:
\n\nassert_eq!(200usize.wrapping_add(55), 255);\nassert_eq!(200usize.wrapping_add(usize::MAX), 199);
1.66.0 (const: 1.66.0) · sourcepub const fn wrapping_add_signed(self, rhs: isize) -> usize
pub const fn wrapping_add_signed(self, rhs: isize) -> usize
Wrapping (modular) addition with a signed integer. Computes\nself + rhs
, wrapping around at the boundary of the type.
§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_add_signed(2), 3);\nassert_eq!(1usize.wrapping_add_signed(-2), usize::MAX);\nassert_eq!((usize::MAX - 2).wrapping_add_signed(4), 1);
1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_sub(self, rhs: usize) -> usize
pub const fn wrapping_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes self - rhs
,\nwrapping around at the boundary of the type.
§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_sub(100), 0);\nassert_eq!(100usize.wrapping_sub(usize::MAX), 101);
1.0.0 (const: 1.32.0) · sourcepub const fn wrapping_mul(self, rhs: usize) -> usize
pub const fn wrapping_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes self * rhs
, wrapping around at the boundary of the type.
§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u8
is used here.
assert_eq!(10u8.wrapping_mul(12), 120);\nassert_eq!(25u8.wrapping_mul(12), 44);
1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_div(self, rhs: usize) -> usize
pub const fn wrapping_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes self / rhs
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
§Panics
\nThis function will panic if rhs
is 0.
§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div(10), 10);
1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_div_euclid(self, rhs: usize) -> usize
pub const fn wrapping_div_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes self.div_euclid(rhs)
.\nWrapped division on unsigned types is just normal division.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_div(rhs)
.
§Panics
\nThis function will panic if rhs
is 0.
§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_div_euclid(10), 10);
1.2.0 (const: 1.52.0) · sourcepub const fn wrapping_rem(self, rhs: usize) -> usize
pub const fn wrapping_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes self % rhs
.\nWrapped remainder calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.
§Panics
\nThis function will panic if rhs
is 0.
§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem(10), 0);
1.38.0 (const: 1.52.0) · sourcepub const fn wrapping_rem_euclid(self, rhs: usize) -> usize
pub const fn wrapping_rem_euclid(self, rhs: usize) -> usize
Wrapping Euclidean modulo. Computes self.rem_euclid(rhs)
.\nWrapped modulo calculation on unsigned types is\njust the regular remainder calculation.\nThere’s no way wrapping could ever happen.\nThis function exists, so that all operations\nare accounted for in the wrapping operations.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.wrapping_rem(rhs)
.
§Panics
\nThis function will panic if rhs
is 0.
§Examples
\nBasic usage:
\n\nassert_eq!(100usize.wrapping_rem_euclid(10), 0);
1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_neg(self) -> usize
pub const fn wrapping_neg(self) -> usize
Wrapping (modular) negation. Computes -self
,\nwrapping around at the boundary of the type.
Since unsigned types do not have negative equivalents\nall applications of this function will wrap (except for -0
).\nFor values smaller than the corresponding signed type’s maximum\nthe result is the same as casting the corresponding signed value.\nAny larger values are equivalent to MAX + 1 - (val - MAX - 1)
where\nMAX
is the corresponding signed type’s maximum.
§Examples
\nBasic usage:
\n\nassert_eq!(0_usize.wrapping_neg(), 0);\nassert_eq!(usize::MAX.wrapping_neg(), 1);\nassert_eq!(13_usize.wrapping_neg(), (!13) + 1);\nassert_eq!(42_usize.wrapping_neg(), !(42 - 1));
1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shl(self, rhs: u32) -> usize
pub const fn wrapping_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields self << mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
Note that this is not the same as a rotate-left; the\nRHS of a wrapping shift-left is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_left
function,\nwhich may be what you want instead.
§Examples
\nBasic usage:
\n\nassert_eq!(1usize.wrapping_shl(7), 128);\nassert_eq!(1usize.wrapping_shl(128), 1);
1.2.0 (const: 1.32.0) · sourcepub const fn wrapping_shr(self, rhs: u32) -> usize
pub const fn wrapping_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields self >> mask(rhs)
,\nwhere mask
removes any high-order bits of rhs
that\nwould cause the shift to exceed the bitwidth of the type.
Note that this is not the same as a rotate-right; the\nRHS of a wrapping shift-right is restricted to the range\nof the type, rather than the bits shifted out of the LHS\nbeing returned to the other end. The primitive integer\ntypes all implement a rotate_right
function,\nwhich may be what you want instead.
§Examples
\nBasic usage:
\n\nassert_eq!(128usize.wrapping_shr(7), 1);\nassert_eq!(128usize.wrapping_shr(128), 128);
1.34.0 (const: 1.50.0) · sourcepub const fn wrapping_pow(self, exp: u32) -> usize
pub const fn wrapping_pow(self, exp: u32) -> usize
Wrapping (modular) exponentiation. Computes self.pow(exp)
,\nwrapping around at the boundary of the type.
§Examples
\nBasic usage:
\n\nassert_eq!(3usize.wrapping_pow(5), 243);\nassert_eq!(3u8.wrapping_pow(6), 217);
1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_add(self, rhs: usize) -> (usize, bool)
pub const fn overflowing_add(self, rhs: usize) -> (usize, bool)
Calculates self
+ rhs
Returns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_add(2), (7, false));\nassert_eq!(usize::MAX.overflowing_add(1), (0, true));
sourcepub const fn carrying_add(self, rhs: usize, carry: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
pub const fn carrying_add(self, rhs: usize, carry: bool) -> (usize, bool)
bigint_helper_methods
)Calculates self
+ rhs
+ carry
and returns a tuple containing\nthe sum and the output carry.
Performs “ternary addition” of two integer operands and a carry-in\nbit, and returns an output integer and a carry-out bit. This allows\nchaining together multiple additions to create a wider addition, and\ncan be useful for bignum addition.
\nThis can be thought of as a 64-bit “full adder”, in the electronics sense.
\nIf the input carry is false, this method is equivalent to\noverflowing_add
, and the output carry is\nequal to the overflow flag. Note that although carry and overflow\nflags are similar for unsigned integers, they are different for\nsigned integers.
§Examples
\n#![feature(bigint_helper_methods)]\n\n// 3 MAX (a = 3 × 2^64 + 2^64 - 1)\n// + 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 9 6 (sum = 9 × 2^64 + 6)\n\nlet (a1, a0): (usize, usize) = (3, usize::MAX);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet carry0 = false;\n\nlet (sum0, carry1) = a0.carrying_add(b0, carry0);\nassert_eq!(carry1, true);\nlet (sum1, carry2) = a1.carrying_add(b1, carry1);\nassert_eq!(carry2, false);\n\nassert_eq!((sum1, sum0), (9, 6));
1.66.0 (const: 1.66.0) · sourcepub const fn overflowing_add_signed(self, rhs: isize) -> (usize, bool)
pub const fn overflowing_add_signed(self, rhs: isize) -> (usize, bool)
Calculates self
+ rhs
with a signed rhs
Returns a tuple of the addition along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\n\nassert_eq!(1usize.overflowing_add_signed(2), (3, false));\nassert_eq!(1usize.overflowing_add_signed(-2), (usize::MAX, true));\nassert_eq!((usize::MAX - 2).overflowing_add_signed(4), (1, true));
1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_sub(self, rhs: usize) -> (usize, bool)
pub const fn overflowing_sub(self, rhs: usize) -> (usize, bool)
Calculates self
- rhs
Returns a tuple of the subtraction along with a boolean indicating\nwhether an arithmetic overflow would occur. If an overflow would\nhave occurred then the wrapped value is returned.
\n§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_sub(2), (3, false));\nassert_eq!(0usize.overflowing_sub(1), (usize::MAX, true));
sourcepub const fn borrowing_sub(self, rhs: usize, borrow: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
pub const fn borrowing_sub(self, rhs: usize, borrow: bool) -> (usize, bool)
bigint_helper_methods
)Calculates self
− rhs
− borrow
and returns a tuple\ncontaining the difference and the output borrow.
Performs “ternary subtraction” by subtracting both an integer\noperand and a borrow-in bit from self
, and returns an output\ninteger and a borrow-out bit. This allows chaining together multiple\nsubtractions to create a wider subtraction, and can be useful for\nbignum subtraction.
§Examples
\n#![feature(bigint_helper_methods)]\n\n// 9 6 (a = 9 × 2^64 + 6)\n// - 5 7 (b = 5 × 2^64 + 7)\n// ---------\n// 3 MAX (diff = 3 × 2^64 + 2^64 - 1)\n\nlet (a1, a0): (usize, usize) = (9, 6);\nlet (b1, b0): (usize, usize) = (5, 7);\nlet borrow0 = false;\n\nlet (diff0, borrow1) = a0.borrowing_sub(b0, borrow0);\nassert_eq!(borrow1, true);\nlet (diff1, borrow2) = a1.borrowing_sub(b1, borrow1);\nassert_eq!(borrow2, false);\n\nassert_eq!((diff1, diff0), (3, usize::MAX));
1.60.0 (const: 1.60.0) · sourcepub const fn abs_diff(self, other: usize) -> usize
pub const fn abs_diff(self, other: usize) -> usize
Computes the absolute difference between self
and other
.
§Examples
\nBasic usage:
\n\nassert_eq!(100usize.abs_diff(80), 20usize);\nassert_eq!(100usize.abs_diff(110), 10usize);
1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_mul(self, rhs: usize) -> (usize, bool)
pub const fn overflowing_mul(self, rhs: usize) -> (usize, bool)
Calculates the multiplication of self
and rhs
.
Returns a tuple of the multiplication along with a boolean\nindicating whether an arithmetic overflow would occur. If an\noverflow would have occurred then the wrapped value is returned.
\n§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
assert_eq!(5u32.overflowing_mul(2), (10, false));\nassert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_div(self, rhs: usize) -> (usize, bool)
pub const fn overflowing_div(self, rhs: usize) -> (usize, bool)
Calculates the divisor when self
is divided by rhs
.
Returns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.
§Panics
\nThis function will panic if rhs
is 0.
§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div(2), (2, false));
1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
pub const fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs)
.
Returns a tuple of the divisor along with a boolean indicating\nwhether an arithmetic overflow would occur. Note that for unsigned\nintegers overflow never occurs, so the second value is always\nfalse
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self.overflowing_div(rhs)
.
§Panics
\nThis function will panic if rhs
is 0.
§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_div_euclid(2), (2, false));
1.7.0 (const: 1.52.0) · sourcepub const fn overflowing_rem(self, rhs: usize) -> (usize, bool)
pub const fn overflowing_rem(self, rhs: usize) -> (usize, bool)
Calculates the remainder when self
is divided by rhs
.
Returns a tuple of the remainder after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.
§Panics
\nThis function will panic if rhs
is 0.
§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem(2), (1, false));
1.38.0 (const: 1.52.0) · sourcepub const fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
pub const fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
Calculates the remainder self.rem_euclid(rhs)
as if by Euclidean division.
Returns a tuple of the modulo after dividing along with a boolean\nindicating whether an arithmetic overflow would occur. Note that for\nunsigned integers overflow never occurs, so the second value is\nalways false
.\nSince, for the positive integers, all common\ndefinitions of division are equal, this operation\nis exactly equal to self.overflowing_rem(rhs)
.
§Panics
\nThis function will panic if rhs
is 0.
§Examples
\nBasic usage
\n\nassert_eq!(5usize.overflowing_rem_euclid(2), (1, false));
1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_neg(self) -> (usize, bool)
pub const fn overflowing_neg(self) -> (usize, bool)
Negates self in an overflowing fashion.
\nReturns !self + 1
using wrapping operations to return the value\nthat represents the negation of this unsigned value. Note that for\npositive unsigned values overflow always occurs, but negating 0 does\nnot overflow.
§Examples
\nBasic usage
\n\nassert_eq!(0usize.overflowing_neg(), (0, false));\nassert_eq!(2usize.overflowing_neg(), (-2i32 as usize, true));
1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shl(self, rhs: u32) -> (usize, bool)
pub const fn overflowing_shl(self, rhs: u32) -> (usize, bool)
Shifts self left by rhs
bits.
Returns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x1usize.overflowing_shl(4), (0x10, false));\nassert_eq!(0x1usize.overflowing_shl(132), (0x10, true));
1.7.0 (const: 1.32.0) · sourcepub const fn overflowing_shr(self, rhs: u32) -> (usize, bool)
pub const fn overflowing_shr(self, rhs: u32) -> (usize, bool)
Shifts self right by rhs
bits.
Returns a tuple of the shifted version of self along with a boolean\nindicating whether the shift value was larger than or equal to the\nnumber of bits. If the shift value is too large, then value is\nmasked (N-1) where N is the number of bits, and this value is then\nused to perform the shift.
\n§Examples
\nBasic usage
\n\nassert_eq!(0x10usize.overflowing_shr(4), (0x1, false));\nassert_eq!(0x10usize.overflowing_shr(132), (0x1, true));
1.34.0 (const: 1.50.0) · sourcepub const fn overflowing_pow(self, exp: u32) -> (usize, bool)
pub const fn overflowing_pow(self, exp: u32) -> (usize, bool)
Raises self to the power of exp
, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicating\nwhether an overflow happened.
\n§Examples
\nBasic usage:
\n\nassert_eq!(3usize.overflowing_pow(5), (243, false));\nassert_eq!(3u8.overflowing_pow(6), (217, true));
1.0.0 (const: 1.50.0) · sourcepub const fn pow(self, exp: u32) -> usize
pub const fn pow(self, exp: u32) -> usize
Raises self to the power of exp
, using exponentiation by squaring.
§Examples
\nBasic usage:
\n\nassert_eq!(2usize.pow(5), 32);
sourcepub const fn isqrt(self) -> usize
🔬This is a nightly-only experimental API. (isqrt
)
pub const fn isqrt(self) -> usize
isqrt
)Returns the square root of the number, rounded down.
\n§Examples
\nBasic usage:
\n\n#![feature(isqrt)]\nassert_eq!(10usize.isqrt(), 3);
1.38.0 (const: 1.52.0) · sourcepub const fn div_euclid(self, rhs: usize) -> usize
pub const fn div_euclid(self, rhs: usize) -> usize
1.38.0 (const: 1.52.0) · sourcepub const fn rem_euclid(self, rhs: usize) -> usize
pub const fn rem_euclid(self, rhs: usize) -> usize
Calculates the least remainder of self (mod rhs)
.
Since, for the positive integers, all common\ndefinitions of division are equal, this\nis exactly equal to self % rhs
.
§Panics
\nThis function will panic if rhs
is 0.
§Examples
\nBasic usage:
\n\nassert_eq!(7usize.rem_euclid(4), 3); // or any other integer type
sourcepub const fn div_floor(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (int_roundings
)
pub const fn div_floor(self, rhs: usize) -> usize
int_roundings
)Calculates the quotient of self
and rhs
, rounding the result towards negative infinity.
This is the same as performing self / rhs
for all unsigned integers.
§Panics
\nThis function will panic if rhs
is zero.
§Examples
\nBasic usage:
\n\n#![feature(int_roundings)]\nassert_eq!(7_usize.div_floor(4), 1);
1.73.0 (const: 1.73.0) · sourcepub const fn next_multiple_of(self, rhs: usize) -> usize
pub const fn next_multiple_of(self, rhs: usize) -> usize
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
.
§Panics
\nThis function will panic if rhs
is zero.
§Overflow behavior
\nOn overflow, this function will panic if overflow checks are enabled (default in debug\nmode) and wrap if overflow checks are disabled (default in release mode).
\n§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.next_multiple_of(8), 16);\nassert_eq!(23_usize.next_multiple_of(8), 24);
1.73.0 (const: 1.73.0) · sourcepub const fn checked_next_multiple_of(self, rhs: usize) -> Option<usize>
pub const fn checked_next_multiple_of(self, rhs: usize) -> Option<usize>
Calculates the smallest value greater than or equal to self
that\nis a multiple of rhs
. Returns None
if rhs
is zero or the\noperation would result in overflow.
§Examples
\nBasic usage:
\n\nassert_eq!(16_usize.checked_next_multiple_of(8), Some(16));\nassert_eq!(23_usize.checked_next_multiple_of(8), Some(24));\nassert_eq!(1_usize.checked_next_multiple_of(0), None);\nassert_eq!(usize::MAX.checked_next_multiple_of(2), None);
1.0.0 (const: 1.32.0) · sourcepub const fn is_power_of_two(self) -> bool
pub const fn is_power_of_two(self) -> bool
Returns true
if and only if self == 2^k
for some k
.
§Examples
\nBasic usage:
\n\nassert!(16usize.is_power_of_two());\nassert!(!10usize.is_power_of_two());
1.0.0 (const: 1.50.0) · sourcepub const fn next_power_of_two(self) -> usize
pub const fn next_power_of_two(self) -> usize
Returns the smallest power of two greater than or equal to self
.
When return value overflows (i.e., self > (1 << (N-1))
for type\nuN
), it panics in debug mode and the return value is wrapped to 0 in\nrelease mode (the only situation in which this method can return 0).
§Examples
\nBasic usage:
\n\nassert_eq!(2usize.next_power_of_two(), 2);\nassert_eq!(3usize.next_power_of_two(), 4);\nassert_eq!(0usize.next_power_of_two(), 1);
1.0.0 (const: 1.50.0) · sourcepub const fn checked_next_power_of_two(self) -> Option<usize>
pub const fn checked_next_power_of_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to self
. If\nthe next power of two is greater than the type’s maximum value,\nNone
is returned, otherwise the power of two is wrapped in Some
.
§Examples
\nBasic usage:
\n\nassert_eq!(2usize.checked_next_power_of_two(), Some(2));\nassert_eq!(3usize.checked_next_power_of_two(), Some(4));\nassert_eq!(usize::MAX.checked_next_power_of_two(), None);
sourcepub const fn wrapping_next_power_of_two(self) -> usize
🔬This is a nightly-only experimental API. (wrapping_next_power_of_two
)
pub const fn wrapping_next_power_of_two(self) -> usize
wrapping_next_power_of_two
)Returns the smallest power of two greater than or equal to n
. If\nthe next power of two is greater than the type’s maximum value,\nthe return value is wrapped to 0
.
§Examples
\nBasic usage:
\n\n#![feature(wrapping_next_power_of_two)]\n\nassert_eq!(2usize.wrapping_next_power_of_two(), 2);\nassert_eq!(3usize.wrapping_next_power_of_two(), 4);\nassert_eq!(usize::MAX.wrapping_next_power_of_two(), 0);
1.32.0 (const: 1.44.0) · sourcepub const fn to_be_bytes(self) -> [u8; 8]
pub const fn to_be_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nbig-endian (network) byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_be_bytes();\nassert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
1.32.0 (const: 1.44.0) · sourcepub const fn to_le_bytes(self) -> [u8; 8]
pub const fn to_le_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nlittle-endian byte order.
\nNote: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_le_bytes();\nassert_eq!(bytes, [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
1.32.0 (const: 1.44.0) · sourcepub const fn to_ne_bytes(self) -> [u8; 8]
pub const fn to_ne_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in\nnative byte order.
\nAs the target platform’s native endianness is used, portable code\nshould use to_be_bytes
or to_le_bytes
, as appropriate,\ninstead.
Note: This function returns an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet bytes = 0x1234567890123456usize.to_ne_bytes();\nassert_eq!(\n bytes,\n if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n } else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n }\n);
1.32.0 (const: 1.44.0) · sourcepub const fn from_be_bytes(bytes: [u8; 8]) -> usize
pub const fn from_be_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in big endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);\nassert_eq!(value, 0x1234567890123456);
When starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_be_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_be_bytes(int_bytes.try_into().unwrap())\n}
1.32.0 (const: 1.44.0) · sourcepub const fn from_le_bytes(bytes: [u8; 8]) -> usize
pub const fn from_le_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation\nas a byte array in little endian.
\nNote: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_le_bytes([0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);\nassert_eq!(value, 0x1234567890123456);
When starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_le_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_le_bytes(int_bytes.try_into().unwrap())\n}
1.32.0 (const: 1.44.0) · sourcepub const fn from_ne_bytes(bytes: [u8; 8]) -> usize
pub const fn from_ne_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its memory representation\nas a byte array in native endianness.
\nAs the target platform’s native endianness is used, portable code\nlikely wants to use from_be_bytes
or from_le_bytes
, as\nappropriate instead.
Note: This function takes an array of length 2, 4 or 8 bytes\ndepending on the target pointer size.
\n§Examples
\nlet value = usize::from_ne_bytes(if cfg!(target_endian = \"big\") {\n [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]\n} else {\n [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]\n});\nassert_eq!(value, 0x1234567890123456);
When starting from a slice rather than an array, fallible conversion APIs can be used:
\n\nfn read_ne_usize(input: &mut &[u8]) -> usize {\n let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());\n *input = rest;\n usize::from_ne_bytes(int_bytes.try_into().unwrap())\n}
1.0.0 (const: 1.32.0) · sourcepub const fn min_value() -> usize
👎Deprecating in a future version: replaced by the MIN
associated constant on this type
pub const fn min_value() -> usize
MIN
associated constant on this typeNew code should prefer to use\nusize::MIN
instead.
Returns the smallest value that can be represented by this integer type.
\n1.0.0 (const: 1.32.0) · sourcepub const fn max_value() -> usize
👎Deprecating in a future version: replaced by the MAX
associated constant on this type
pub const fn max_value() -> usize
MAX
associated constant on this typeNew code should prefer to use\nusize::MAX
instead.
Returns the largest value that can be represented by this integer type.
\nsourcepub const fn widening_mul(self, rhs: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
pub const fn widening_mul(self, rhs: usize) -> (usize, usize)
bigint_helper_methods
)Calculates the complete product self * rhs
without the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nIf you also need to add a carry to the wide result, then you want\nSelf::carrying_mul
instead.
§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
#![feature(bigint_helper_methods)]\nassert_eq!(5u32.widening_mul(2), (10, 0));\nassert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));
sourcepub const fn carrying_mul(self, rhs: usize, carry: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (bigint_helper_methods
)
pub const fn carrying_mul(self, rhs: usize, carry: usize) -> (usize, usize)
bigint_helper_methods
)Calculates the “full multiplication” self * rhs + carry
\nwithout the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bits\nof the result as two separate values, in that order.
\nPerforms “long multiplication” which takes in an extra amount to add, and may return an\nadditional amount of overflow. This allows for chaining together multiple\nmultiplications to create “big integers” which represent larger values.
\nIf you don’t need the carry
, then you can use Self::widening_mul
instead.
§Examples
\nBasic usage:
\nPlease note that this example is shared between integer types.\nWhich explains why u32
is used here.
#![feature(bigint_helper_methods)]\nassert_eq!(5u32.carrying_mul(2, 0), (10, 0));\nassert_eq!(5u32.carrying_mul(2, 10), (20, 0));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));\nassert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));\nassert_eq!(usize::MAX.carrying_mul(usize::MAX, usize::MAX), (0, usize::MAX));
This is the core operation needed for scalar multiplication when\nimplementing it for wider-than-native types.
\n\n#![feature(bigint_helper_methods)]\nfn scalar_mul_eq(little_endian_digits: &mut Vec<u16>, multiplicand: u16) {\n let mut carry = 0;\n for d in little_endian_digits.iter_mut() {\n (*d, carry) = d.carrying_mul(multiplicand, carry);\n }\n if carry != 0 {\n little_endian_digits.push(carry);\n }\n}\n\nlet mut v = vec![10, 20];\nscalar_mul_eq(&mut v, 3);\nassert_eq!(v, [30, 60]);\n\nassert_eq!(0x87654321_u64 * 0xFEED, 0x86D3D159E38D);\nlet mut v = vec![0x4321, 0x8765];\nscalar_mul_eq(&mut v, 0xFEED);\nassert_eq!(v, [0xE38D, 0xD159, 0x86D3]);
If carry
is zero, this is similar to overflowing_mul
,\nexcept that it gives the value of the overflow instead of just whether one happened:
#![feature(bigint_helper_methods)]\nlet r = u8::carrying_mul(7, 13, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));\nlet r = u8::carrying_mul(13, 42, 0);\nassert_eq!((r.0, r.1 != 0), u8::overflowing_mul(13, 42));
The value of the first field in the returned tuple matches what you’d get\nby combining the wrapping_mul
and\nwrapping_add
methods:
#![feature(bigint_helper_methods)]\nassert_eq!(\n 789_u16.carrying_mul(456, 123).0,\n 789_u16.wrapping_mul(456).wrapping_add(123),\n);
sourcepub const fn midpoint(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (num_midpoint
)
pub const fn midpoint(self, rhs: usize) -> usize
num_midpoint
)Calculates the middle point of self
and rhs
.
midpoint(a, b)
is (a + b) >> 1
as if it were performed in a\nsufficiently-large signed integral type. This implies that the result is\nalways rounded towards negative infinity and that no overflow will ever occur.
§Examples
\n#![feature(num_midpoint)]\nassert_eq!(0usize.midpoint(4), 2);\nassert_eq!(1usize.midpoint(4), 2);
source§impl usize
impl usize
1.0.0 (const: unstable) · sourcepub fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
pub fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer.
\nThe string is expected to be an optional +
sign\nfollowed by digits.\nLeading and trailing whitespace represent an error.\nDigits are a subset of these characters, depending on radix
:
- \n
0-9
\na-z
\nA-Z
\n
§Panics
\nThis function panics if radix
is not in the range from 2 to 36.
§Examples
\nBasic usage:
\n\nassert_eq!(usize::from_str_radix(\"A\", 16), Ok(10));
impl AtLeast16 for usize
impl AtLeast32 for usize
impl AtLeast64 for usize
impl AtLeast8 for usize
impl AtMost128 for usize
impl AtMost64 for usize
impl BitOps for usize
impl ConstParamTy for usize
impl Copy for usize
impl DefaultIsZeroes for usize
impl Eq for usize
impl ExtendTarget<usize> for usize
impl Index for usize
impl Index for usize
impl Integer for usize
impl Is64 for usize
impl NotAutoValue for usize
impl NumericOps for usize
impl SimdCast for usize
impl StructuralPartialEq for usize
impl TruncateTarget<u16> for usize
impl TruncateTarget<u8> for usize
impl TruncateTarget<usize> for usize
impl TrustedStep for usize
impl Uint for usize
impl Unsigned for usize
impl Weight for usize
impl ZeroablePrimitive for usize
1.22.0 · source§impl AddAssign<&usize> for usize
impl AddAssign<&usize> for usize
source§fn add_assign(&mut self, other: &usize)
fn add_assign(&mut self, other: &usize)
+=
operation. Read more1.8.0 · source§impl AddAssign for usize
impl AddAssign for usize
source§fn add_assign(&mut self, other: usize)
fn add_assign(&mut self, other: usize)
+=
operation. Read more§impl AsBytes for usize
impl AsBytes for usize
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere\n Self: FromBytes,
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
source§impl AsPrimitive<f32> for usize
impl AsPrimitive<f32> for usize
source§impl AsPrimitive<f64> for usize
impl AsPrimitive<f64> for usize
source§impl AsPrimitive<i128> for usize
impl AsPrimitive<i128> for usize
source§impl AsPrimitive<i16> for usize
impl AsPrimitive<i16> for usize
source§impl AsPrimitive<i32> for usize
impl AsPrimitive<i32> for usize
source§impl AsPrimitive<i64> for usize
impl AsPrimitive<i64> for usize
source§impl AsPrimitive<i8> for usize
impl AsPrimitive<i8> for usize
source§impl AsPrimitive<isize> for usize
impl AsPrimitive<isize> for usize
source§impl AsPrimitive<u128> for usize
impl AsPrimitive<u128> for usize
source§impl AsPrimitive<u16> for usize
impl AsPrimitive<u16> for usize
source§impl AsPrimitive<u32> for usize
impl AsPrimitive<u32> for usize
source§impl AsPrimitive<u64> for usize
impl AsPrimitive<u64> for usize
source§impl AsPrimitive<u8> for usize
impl AsPrimitive<u8> for usize
source§impl AsPrimitive<usize> for usize
impl AsPrimitive<usize> for usize
1.22.0 · source§impl BitAndAssign<&usize> for usize
impl BitAndAssign<&usize> for usize
source§fn bitand_assign(&mut self, other: &usize)
fn bitand_assign(&mut self, other: &usize)
&=
operation. Read more1.8.0 · source§impl BitAndAssign for usize
impl BitAndAssign for usize
source§fn bitand_assign(&mut self, other: usize)
fn bitand_assign(&mut self, other: usize)
&=
operation. Read more1.22.0 · source§impl BitOrAssign<&usize> for usize
impl BitOrAssign<&usize> for usize
source§fn bitor_assign(&mut self, other: &usize)
fn bitor_assign(&mut self, other: &usize)
|=
operation. Read more1.8.0 · source§impl BitOrAssign for usize
impl BitOrAssign for usize
source§fn bitor_assign(&mut self, other: usize)
fn bitor_assign(&mut self, other: usize)
|=
operation. Read more§impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
impl<'a, T, O> BitSliceIndex<'a, T, O> for usizewhere\n T: BitStore,\n O: BitOrder,
§fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
fn get(\n self,\n bits: &'a BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Immut>
§fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
fn get_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> Option<<usize as BitSliceIndex<'a, T, O>>::Mut>
§unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
unsafe fn get_unchecked(\n self,\n bits: &'a BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Immut
§unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
unsafe fn get_unchecked_mut(\n self,\n bits: &'a mut BitSlice<T, O>,\n) -> <usize as BitSliceIndex<'a, T, O>>::Mut
§impl BitStore for usize
impl BitStore for usize
§type Access = Cell<usize>
type Access = Cell<usize>
The unsigned integers will only be BitStore
type parameters\nfor handles to unaliased memory, following the normal Rust\nreference rules.
§type Mem = usize
type Mem = usize
BitSlice
. It\nis always one of the unsigned integer fundamentals.§type Alias = BitSafeUsize
type Alias = BitSafeUsize
BitStore
implementor that is known to be alias-safe. It is\nused when a BitSlice
introduces multiple handles that view the same\nmemory location, and at least one of them has write capabilities to it.\nIt must have the same underlying memory type, and can only change access\npatterns or public-facing usage.§type Unalias = usize
type Unalias = usize
::Alias
. It is used when a BitSlice
removes the\nconditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <usize as BitStore>::Mem
fn load_value(&self) -> <usize as BitStore>::Mem
::Access
\nrules. This may be called when the value is aliased by a write-capable\nreference.§fn store_value(&mut self, value: <usize as BitStore>::Mem)
fn store_value(&mut self, value: <usize as BitStore>::Mem)
::Access
\nconstraints.§const ALIGNED_TO_SIZE: [(); 1] = _
const ALIGNED_TO_SIZE: [(); 1] = _
§const ALIAS_WIDTH: [(); 1] = _
const ALIAS_WIDTH: [(); 1] = _
Self
and Self::Alias
be equal\nin representation. This is true by fiat for all types except the\nunsigned integers. Read more1.22.0 · source§impl BitXorAssign<&usize> for usize
impl BitXorAssign<&usize> for usize
source§fn bitxor_assign(&mut self, other: &usize)
fn bitxor_assign(&mut self, other: &usize)
^=
operation. Read more1.8.0 · source§impl BitXorAssign for usize
impl BitXorAssign for usize
source§fn bitxor_assign(&mut self, other: usize)
fn bitxor_assign(&mut self, other: usize)
^=
operation. Read moresource§impl CheckedAdd for usize
impl CheckedAdd for usize
source§impl CheckedDiv for usize
impl CheckedDiv for usize
source§impl CheckedEuclid for usize
impl CheckedEuclid for usize
source§fn checked_div_euclid(&self, v: &usize) -> Option<usize>
fn checked_div_euclid(&self, v: &usize) -> Option<usize>
None
instead of panicking on division by zero\nand instead of wrapping around on underflow and overflow.source§fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
fn checked_rem_euclid(&self, v: &usize) -> Option<usize>
None
is returned.source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
source§impl CheckedMul for usize
impl CheckedMul for usize
source§impl CheckedNeg for usize
impl CheckedNeg for usize
source§impl CheckedRem for usize
impl CheckedRem for usize
source§impl CheckedShl for usize
impl CheckedShl for usize
source§impl CheckedShr for usize
impl CheckedShr for usize
source§impl CheckedSub for usize
impl CheckedSub for usize
§impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
impl<T> CheckedSum<usize> for Twhere\n T: IntoIterator<Item = usize>,
§fn checked_sum(self) -> Result<usize, Error>
fn checked_sum(self) -> Result<usize, Error>
source§impl ConstantTimeEq for usize
impl ConstantTimeEq for usize
§impl Decode for usize
impl Decode for usize
Decode a usize
.
Uses [Decode
] impl on u32
and then converts to a usize
, handling\npotential overflow if usize
is smaller than u32
.
Enforces a library-internal limit of 1048575, as the main use case for\nusize
is length prefixes.
source§impl<'de> Deserialize<'de> for usize
impl<'de> Deserialize<'de> for usize
source§fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
fn deserialize<D>(\n deserializer: D,\n) -> Result<usize, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,
1.0.0 · source§impl Div for usize
impl Div for usize
This operation rounds towards zero, truncating any\nfractional part of the exact result.
\n§Panics
\nThis operation will panic if other == 0
.
1.22.0 · source§impl DivAssign<&usize> for usize
impl DivAssign<&usize> for usize
source§fn div_assign(&mut self, other: &usize)
fn div_assign(&mut self, other: &usize)
/=
operation. Read more1.79.0 · source§impl DivAssign<NonZero<usize>> for usize
impl DivAssign<NonZero<usize>> for usize
source§fn div_assign(&mut self, other: NonZero<usize>)
fn div_assign(&mut self, other: NonZero<usize>)
This operation rounds towards zero, truncating any fractional\npart of the exact result, and cannot panic.
\n1.8.0 · source§impl DivAssign for usize
impl DivAssign for usize
source§fn div_assign(&mut self, other: usize)
fn div_assign(&mut self, other: usize)
/=
operation. Read more§impl Encode for usize
impl Encode for usize
Encode a usize
as a uint32
as described in RFC4251 § 5.
Uses [Encode
] impl on u32
after converting from a usize
, handling\npotential overflow if usize
is bigger than u32
.
§fn encoded_len(&self) -> Result<usize, Error>
fn encoded_len(&self) -> Result<usize, Error>
§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Writer
].§fn encoded_len_prefixed(&self) -> Result<usize, Error>
fn encoded_len_prefixed(&self) -> Result<usize, Error>
uint32
length prefix.§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
uint32
length prefix\nset to [Encode::encoded_len
].source§impl Euclid for usize
impl Euclid for usize
source§fn div_euclid(&self, v: &usize) -> usize
fn div_euclid(&self, v: &usize) -> usize
rem_euclid
. Read moresource§fn rem_euclid(&self, v: &usize) -> usize
fn rem_euclid(&self, v: &usize) -> usize
self (mod v)
. Read moresource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
source§impl FromBytes for usize
impl FromBytes for usize
type Bytes = [u8; 8]
source§fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
fn from_be_bytes(bytes: &<usize as FromBytes>::Bytes) -> usize
§impl FromBytes for usize
impl FromBytes for usize
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where\n Self: Sized,
bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where\n Self: Sized,
bytes
as a &[Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
fn mut_slice_from_prefix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [Self], &mut [u8])>where\n Self: Sized + AsBytes,
bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
fn mut_slice_from_suffix(\n bytes: &mut [u8],\n count: usize,\n) -> Option<(&mut [u8], &mut [Self])>where\n Self: Sized + AsBytes,
bytes
as a &mut [Self]
with length\nequal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
fn read_from_prefix(bytes: &[u8]) -> Option<Self>where\n Self: Sized,
source§impl FromPrimitive for usize
impl FromPrimitive for usize
source§fn from_isize(n: isize) -> Option<usize>
fn from_isize(n: isize) -> Option<usize>
isize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<usize>
fn from_i8(n: i8) -> Option<usize>
i8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<usize>
fn from_i16(n: i16) -> Option<usize>
i16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<usize>
fn from_i32(n: i32) -> Option<usize>
i32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i64(n: i64) -> Option<usize>
fn from_i64(n: i64) -> Option<usize>
i64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<usize>
fn from_i128(n: i128) -> Option<usize>
i128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<usize>
fn from_usize(n: usize) -> Option<usize>
usize
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<usize>
fn from_u8(n: u8) -> Option<usize>
u8
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<usize>
fn from_u16(n: u16) -> Option<usize>
u16
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<usize>
fn from_u32(n: u32) -> Option<usize>
u32
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<usize>
fn from_u64(n: u64) -> Option<usize>
u64
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<usize>
fn from_u128(n: u128) -> Option<usize>
u128
to return an optional value of this type. If the\nvalue cannot be represented by this type, then None
is returned. Read more§impl FromSql for usize
impl FromSql for usize
§fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
fn column_result(value: ValueRef<'_>) -> Result<usize, FromSqlError>
source§impl Integer for usize
impl Integer for usize
source§fn div_floor(&self, other: &usize) -> usize
fn div_floor(&self, other: &usize) -> usize
Unsigned integer division. Returns the same result as div
(/
).
source§fn mod_floor(&self, other: &usize) -> usize
fn mod_floor(&self, other: &usize) -> usize
Unsigned integer modulo operation. Returns the same result as rem
(%
).
source§fn gcd(&self, other: &usize) -> usize
fn gcd(&self, other: &usize) -> usize
Calculates the Greatest Common Divisor (GCD) of the number and other
source§fn lcm(&self, other: &usize) -> usize
fn lcm(&self, other: &usize) -> usize
Calculates the Lowest Common Multiple (LCM) of the number and other
.
source§fn gcd_lcm(&self, other: &usize) -> (usize, usize)
fn gcd_lcm(&self, other: &usize) -> (usize, usize)
Calculates the Greatest Common Divisor (GCD) and\nLowest Common Multiple (LCM) of the number and other
.
source§fn is_multiple_of(&self, other: &usize) -> bool
fn is_multiple_of(&self, other: &usize) -> bool
Returns true
if the number is a multiple of other
.
source§fn div_rem(&self, other: &usize) -> (usize, usize)
fn div_rem(&self, other: &usize) -> (usize, usize)
Simultaneous truncated integer division and modulus.
\nsource§fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
fn extended_gcd_lcm(&self, other: &usize) -> (ExtendedGcd<usize>, usize)
source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where\n Self: Clone,
source§fn divides(&self, other: &Self) -> bool
fn divides(&self, other: &Self) -> bool
is_multiple_of
instead.source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
fn div_mod_floor(&self, other: &Self) -> (Self, Self)
(quotient, remainder)
. Read moresource§fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
fn next_multiple_of(&self, other: &Self) -> Selfwhere\n Self: Clone,
§impl Integral for usize
impl Integral for usize
§fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
§fn count_ones(self) -> u32
fn count_ones(self) -> u32
self
.§fn count_zeros(self) -> u32
fn count_zeros(self) -> u32
self
.§fn leading_zeros(self) -> u32
fn leading_zeros(self) -> u32
self
.§fn trailing_zeros(self) -> u32
fn trailing_zeros(self) -> u32
self
.§fn leading_ones(self) -> u32
fn leading_ones(self) -> u32
self
.§fn trailing_ones(self) -> u32
fn trailing_ones(self) -> u32
self
.§fn rotate_left(self, n: u32) -> usize
fn rotate_left(self, n: u32) -> usize
n
, wrapping the\ntruncated bits to the end of the resulting integer. Read more§fn rotate_right(self, n: u32) -> usize
fn rotate_right(self, n: u32) -> usize
n
, wrapping the\ntruncated bits to the beginning of the resulting integer. Read more§fn swap_bytes(self) -> usize
fn swap_bytes(self) -> usize
§fn reverse_bits(self) -> usize
fn reverse_bits(self) -> usize
§fn from_le(self) -> usize
fn from_le(self) -> usize
§fn checked_add(self, rhs: usize) -> Option<usize>
fn checked_add(self, rhs: usize) -> Option<usize>
self + rhs
, returning None
if\noverflow occurred.§fn checked_sub(self, rhs: usize) -> Option<usize>
fn checked_sub(self, rhs: usize) -> Option<usize>
self - rhs
, returning None
if\noverflow occurred.§fn checked_mul(self, rhs: usize) -> Option<usize>
fn checked_mul(self, rhs: usize) -> Option<usize>
self * rhs
, returning None
\nif overflow occurred.§fn checked_div(self, rhs: usize) -> Option<usize>
fn checked_div(self, rhs: usize) -> Option<usize>
self / rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_div_euclid(self, rhs: usize) -> Option<usize>
fn checked_div_euclid(self, rhs: usize) -> Option<usize>
self.div_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_rem(self, rhs: usize) -> Option<usize>
fn checked_rem(self, rhs: usize) -> Option<usize>
self % rhs
, returning None
if\nrhs == 0
or the division results in overflow.§fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
fn checked_rem_euclid(self, rhs: usize) -> Option<usize>
self.rem_euclid(rhs)
, returning\nNone
if rhs == 0
or the division results in overflow.§fn checked_neg(self) -> Option<usize>
fn checked_neg(self) -> Option<usize>
§fn checked_shl(self, rhs: u32) -> Option<usize>
fn checked_shl(self, rhs: u32) -> Option<usize>
self << rhs
, returning None
if rhs
is\nlarger than or equal to the number of bits in self
.§fn checked_shr(self, rhs: u32) -> Option<usize>
fn checked_shr(self, rhs: u32) -> Option<usize>
self >> rhs
, returning None
if rhs
\nis larger than or equal to the number of bits in self
.§fn checked_pow(self, rhs: u32) -> Option<usize>
fn checked_pow(self, rhs: u32) -> Option<usize>
self.pow(exp)
, returning None
if\noverflow occurred.§fn saturating_add(self, rhs: usize) -> usize
fn saturating_add(self, rhs: usize) -> usize
self + rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_sub(self, rhs: usize) -> usize
fn saturating_sub(self, rhs: usize) -> usize
self - rhs
, saturating at the\nnumeric bounds instead of overflowing.§fn saturating_mul(self, rhs: usize) -> usize
fn saturating_mul(self, rhs: usize) -> usize
self * rhs
, saturating at\nthe numeric bounds instead of overflowing.§fn saturating_pow(self, rhs: u32) -> usize
fn saturating_pow(self, rhs: u32) -> usize
self.pow(exp)
, saturating\nat the numeric bounds instead of overflowing.§fn wrapping_add(self, rhs: usize) -> usize
fn wrapping_add(self, rhs: usize) -> usize
self + rhs
, wrapping around at\nthe boundary of the type.§fn wrapping_sub(self, rhs: usize) -> usize
fn wrapping_sub(self, rhs: usize) -> usize
self - rhs
, wrapping around\nat the boundary of the type.§fn wrapping_mul(self, rhs: usize) -> usize
fn wrapping_mul(self, rhs: usize) -> usize
self * rhs
, wrapping\naround at the boundary of the type.§fn wrapping_div(self, rhs: usize) -> usize
fn wrapping_div(self, rhs: usize) -> usize
self / rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_div_euclid(self, rhs: usize) -> usize
fn wrapping_div_euclid(self, rhs: usize) -> usize
self.div_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_rem(self, rhs: usize) -> usize
fn wrapping_rem(self, rhs: usize) -> usize
self % rhs
, wrapping around at\nthe boundary of the type. Read more§fn wrapping_rem_euclid(self, rhs: usize) -> usize
fn wrapping_rem_euclid(self, rhs: usize) -> usize
self.rem_euclid(rhs)
, wrapping\naround at the boundary of the type. Read more§fn wrapping_neg(self) -> usize
fn wrapping_neg(self) -> usize
-self
, wrapping around at the\nboundary of the type. Read more§fn wrapping_shl(self, rhs: u32) -> usize
fn wrapping_shl(self, rhs: u32) -> usize
self << mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_shr(self, rhs: u32) -> usize
fn wrapping_shr(self, rhs: u32) -> usize
self >> mask(rhs)
, where mask
\nremoves any high-order bits of rhs
that would cause the shift to\nexceed the bit-width of the type. Read more§fn wrapping_pow(self, rhs: u32) -> usize
fn wrapping_pow(self, rhs: u32) -> usize
self.pow(exp)
, wrapping\naround at the boundary of the type.§fn overflowing_mul(self, rhs: usize) -> (usize, bool)
fn overflowing_mul(self, rhs: usize) -> (usize, bool)
§fn overflowing_div(self, rhs: usize) -> (usize, bool)
fn overflowing_div(self, rhs: usize) -> (usize, bool)
§fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
fn overflowing_div_euclid(self, rhs: usize) -> (usize, bool)
self.div_euclid(rhs)
. Read more§fn overflowing_rem(self, rhs: usize) -> (usize, bool)
fn overflowing_rem(self, rhs: usize) -> (usize, bool)
§fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
fn overflowing_rem_euclid(self, rhs: usize) -> (usize, bool)
self.rem_euclid(rhs)
. Read more§fn overflowing_neg(self) -> (usize, bool)
fn overflowing_neg(self) -> (usize, bool)
§fn overflowing_pow(self, rhs: u32) -> (usize, bool)
fn overflowing_pow(self, rhs: u32) -> (usize, bool)
exp
, using exponentiation by squaring. Read more§fn div_euclid(self, rhs: usize) -> usize
fn div_euclid(self, rhs: usize) -> usize
§fn rem_euclid(self, rhs: usize) -> usize
fn rem_euclid(self, rhs: usize) -> usize
self (mod rhs)
. Read moresource§impl IntoBigInt for usize
impl IntoBigInt for usize
source§fn into_bigint(self) -> Option<BigInt>
fn into_bigint(self) -> Option<BigInt>
self
to a BigInt
.source§impl IntoBigUint for usize
impl IntoBigUint for usize
source§fn into_biguint(self) -> Option<BigUint>
fn into_biguint(self) -> Option<BigUint>
self
to a BigUint
.source§impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
impl<'de, E> IntoDeserializer<'de, E> for usizewhere\n E: Error,
§type Deserializer = UsizeDeserializer<E>
type Deserializer = UsizeDeserializer<E>
source§fn into_deserializer(self) -> UsizeDeserializer<E>
fn into_deserializer(self) -> UsizeDeserializer<E>
§impl IntoNotification for usize
impl IntoNotification for usize
§fn into_notification(self) -> <usize as IntoNotification>::Notify
fn into_notification(self) -> <usize as IntoNotification>::Notify
§fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
fn additional(self) -> Additional<Self::Notify>where\n Self: Sized,
§fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
fn relaxed(self) -> Relaxed<Self::Notify>where\n Self: Sized,
source§impl MulAddAssign for usize
impl MulAddAssign for usize
source§fn mul_add_assign(&mut self, a: usize, b: usize)
fn mul_add_assign(&mut self, a: usize, b: usize)
*self = (*self * a) + b
1.22.0 · source§impl MulAssign<&usize> for usize
impl MulAssign<&usize> for usize
source§fn mul_assign(&mut self, other: &usize)
fn mul_assign(&mut self, other: &usize)
*=
operation. Read more1.8.0 · source§impl MulAssign for usize
impl MulAssign for usize
source§fn mul_assign(&mut self, other: usize)
fn mul_assign(&mut self, other: usize)
*=
operation. Read moresource§impl Num for usize
impl Num for usize
type FromStrRadixErr = ParseIntError
source§fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>
2..=36
). Read more§impl Numeric for usize
impl Numeric for usize
§fn to_be_bytes(self) -> <usize as Numeric>::Bytes
fn to_be_bytes(self) -> <usize as Numeric>::Bytes
§fn to_le_bytes(self) -> <usize as Numeric>::Bytes
fn to_le_bytes(self) -> <usize as Numeric>::Bytes
§fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
fn to_ne_bytes(self) -> <usize as Numeric>::Bytes
§fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
fn from_be_bytes(bytes: <usize as Numeric>::Bytes) -> usize
§fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
fn from_le_bytes(bytes: <usize as Numeric>::Bytes) -> usize
§fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
fn from_ne_bytes(bytes: <usize as Numeric>::Bytes) -> usize
1.0.0 · source§impl Ord for usize
impl Ord for usize
source§impl OverflowingAdd for usize
impl OverflowingAdd for usize
source§impl OverflowingMul for usize
impl OverflowingMul for usize
source§impl OverflowingSub for usize
impl OverflowingSub for usize
source§impl PartialEq<Value> for usize
impl PartialEq<Value> for usize
1.0.0 · source§impl PartialOrd for usize
impl PartialOrd for usize
source§fn le(&self, other: &usize) -> bool
fn le(&self, other: &usize) -> bool
self
and other
) and is used by the <=
\noperator. Read moresource§impl PrimInt for usize
impl PrimInt for usize
source§fn count_ones(self) -> u32
fn count_ones(self) -> u32
self
. Read moresource§fn count_zeros(self) -> u32
fn count_zeros(self) -> u32
self
. Read moresource§fn leading_ones(self) -> u32
fn leading_ones(self) -> u32
self
. Read moresource§fn leading_zeros(self) -> u32
fn leading_zeros(self) -> u32
self
. Read moresource§fn trailing_ones(self) -> u32
fn trailing_ones(self) -> u32
self
. Read moresource§fn trailing_zeros(self) -> u32
fn trailing_zeros(self) -> u32
self
. Read moresource§fn rotate_left(self, n: u32) -> usize
fn rotate_left(self, n: u32) -> usize
n
, wrapping\nthe truncated bits to the end of the resulting integer. Read moresource§fn rotate_right(self, n: u32) -> usize
fn rotate_right(self, n: u32) -> usize
n
, wrapping\nthe truncated bits to the beginning of the resulting integer. Read moresource§fn signed_shl(self, n: u32) -> usize
fn signed_shl(self, n: u32) -> usize
n
, filling\nzeros in the least significant bits. Read moresource§fn signed_shr(self, n: u32) -> usize
fn signed_shr(self, n: u32) -> usize
n
, copying\nthe “sign bit” in the most significant bits even for unsigned types. Read moresource§fn unsigned_shl(self, n: u32) -> usize
fn unsigned_shl(self, n: u32) -> usize
n
, filling\nzeros in the least significant bits. Read moresource§fn unsigned_shr(self, n: u32) -> usize
fn unsigned_shr(self, n: u32) -> usize
n
, filling\nzeros in the most significant bits. Read moresource§fn swap_bytes(self) -> usize
fn swap_bytes(self) -> usize
source§fn reverse_bits(self) -> usize
fn reverse_bits(self) -> usize
source§fn from_be(x: usize) -> usize
fn from_be(x: usize) -> usize
§impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
impl<R> RangeExt<usize> for Rwhere\n R: RangeBounds<usize>,
§fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
fn normalize(\n self,\n start: impl Into<Option<usize>>,\n end: impl Into<Option<usize>>,\n) -> Range<usize>
Range
. Read more1.0.0 · source§impl Rem for usize
impl Rem for usize
This operation satisfies n % d == n - (n / d) * d
. The\nresult has the same sign as the left operand.
§Panics
\nThis operation will panic if other == 0
.
source§impl<'a> RemAssign<&'a BigUint> for usize
impl<'a> RemAssign<&'a BigUint> for usize
source§fn rem_assign(&mut self, other: &BigUint)
fn rem_assign(&mut self, other: &BigUint)
%=
operation. Read more1.22.0 · source§impl RemAssign<&usize> for usize
impl RemAssign<&usize> for usize
source§fn rem_assign(&mut self, other: &usize)
fn rem_assign(&mut self, other: &usize)
%=
operation. Read moresource§impl RemAssign<BigUint> for usize
impl RemAssign<BigUint> for usize
source§fn rem_assign(&mut self, other: BigUint)
fn rem_assign(&mut self, other: BigUint)
%=
operation. Read more1.79.0 · source§impl RemAssign<NonZero<usize>> for usize
impl RemAssign<NonZero<usize>> for usize
source§fn rem_assign(&mut self, other: NonZero<usize>)
fn rem_assign(&mut self, other: NonZero<usize>)
This operation satisfies n % d == n - (n / d) * d
, and cannot panic.
1.8.0 · source§impl RemAssign for usize
impl RemAssign for usize
source§fn rem_assign(&mut self, other: usize)
fn rem_assign(&mut self, other: usize)
%=
operation. Read moresource§impl Roots for usize
impl Roots for usize
source§impl SampleUniform for usize
impl SampleUniform for usize
§type Sampler = UniformInt<usize>
type Sampler = UniformInt<usize>
UniformSampler
implementation supporting type X
.source§impl Saturating for usize
impl Saturating for usize
source§fn saturating_add(self, v: usize) -> usize
fn saturating_add(self, v: usize) -> usize
source§fn saturating_sub(self, v: usize) -> usize
fn saturating_sub(self, v: usize) -> usize
source§impl SaturatingAdd for usize
impl SaturatingAdd for usize
source§fn saturating_add(&self, v: &usize) -> usize
fn saturating_add(&self, v: &usize) -> usize
self + other
, saturating at the relevant high or low boundary of\nthe type.source§impl SaturatingMul for usize
impl SaturatingMul for usize
source§fn saturating_mul(&self, v: &usize) -> usize
fn saturating_mul(&self, v: &usize) -> usize
self * other
, saturating at the relevant high or low boundary of\nthe type.source§impl SaturatingSub for usize
impl SaturatingSub for usize
source§fn saturating_sub(&self, v: &usize) -> usize
fn saturating_sub(&self, v: &usize) -> usize
self - other
, saturating at the relevant high or low boundary of\nthe type.§impl SeekNum for usize
impl SeekNum for usize
§fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
fn from_block_byte<T>(\n block: T,\n byte: u8,\n bs: u8,\n) -> Result<usize, OverflowError>where\n T: Counter,
block
, byte position inside\nblock byte
, and block size bs
.§fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
fn into_block_byte<T>(self, bs: u8) -> Result<(T, u8), OverflowError>where\n T: Counter,
bs
.source§impl Serialize for usize
impl Serialize for usize
source§fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,
1.22.0 · source§impl ShlAssign<&i128> for usize
impl ShlAssign<&i128> for usize
source§fn shl_assign(&mut self, other: &i128)
fn shl_assign(&mut self, other: &i128)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&i16> for usize
impl ShlAssign<&i16> for usize
source§fn shl_assign(&mut self, other: &i16)
fn shl_assign(&mut self, other: &i16)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&i32> for usize
impl ShlAssign<&i32> for usize
source§fn shl_assign(&mut self, other: &i32)
fn shl_assign(&mut self, other: &i32)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&i64> for usize
impl ShlAssign<&i64> for usize
source§fn shl_assign(&mut self, other: &i64)
fn shl_assign(&mut self, other: &i64)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&i8> for usize
impl ShlAssign<&i8> for usize
source§fn shl_assign(&mut self, other: &i8)
fn shl_assign(&mut self, other: &i8)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&isize> for usize
impl ShlAssign<&isize> for usize
source§fn shl_assign(&mut self, other: &isize)
fn shl_assign(&mut self, other: &isize)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&u128> for usize
impl ShlAssign<&u128> for usize
source§fn shl_assign(&mut self, other: &u128)
fn shl_assign(&mut self, other: &u128)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&u16> for usize
impl ShlAssign<&u16> for usize
source§fn shl_assign(&mut self, other: &u16)
fn shl_assign(&mut self, other: &u16)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&u32> for usize
impl ShlAssign<&u32> for usize
source§fn shl_assign(&mut self, other: &u32)
fn shl_assign(&mut self, other: &u32)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&u64> for usize
impl ShlAssign<&u64> for usize
source§fn shl_assign(&mut self, other: &u64)
fn shl_assign(&mut self, other: &u64)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&u8> for usize
impl ShlAssign<&u8> for usize
source§fn shl_assign(&mut self, other: &u8)
fn shl_assign(&mut self, other: &u8)
<<=
operation. Read more1.22.0 · source§impl ShlAssign<&usize> for usize
impl ShlAssign<&usize> for usize
source§fn shl_assign(&mut self, other: &usize)
fn shl_assign(&mut self, other: &usize)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<i128> for usize
impl ShlAssign<i128> for usize
source§fn shl_assign(&mut self, other: i128)
fn shl_assign(&mut self, other: i128)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<i16> for usize
impl ShlAssign<i16> for usize
source§fn shl_assign(&mut self, other: i16)
fn shl_assign(&mut self, other: i16)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<i32> for usize
impl ShlAssign<i32> for usize
source§fn shl_assign(&mut self, other: i32)
fn shl_assign(&mut self, other: i32)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<i64> for usize
impl ShlAssign<i64> for usize
source§fn shl_assign(&mut self, other: i64)
fn shl_assign(&mut self, other: i64)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<i8> for usize
impl ShlAssign<i8> for usize
source§fn shl_assign(&mut self, other: i8)
fn shl_assign(&mut self, other: i8)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<isize> for usize
impl ShlAssign<isize> for usize
source§fn shl_assign(&mut self, other: isize)
fn shl_assign(&mut self, other: isize)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<u128> for usize
impl ShlAssign<u128> for usize
source§fn shl_assign(&mut self, other: u128)
fn shl_assign(&mut self, other: u128)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<u16> for usize
impl ShlAssign<u16> for usize
source§fn shl_assign(&mut self, other: u16)
fn shl_assign(&mut self, other: u16)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<u32> for usize
impl ShlAssign<u32> for usize
source§fn shl_assign(&mut self, other: u32)
fn shl_assign(&mut self, other: u32)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<u64> for usize
impl ShlAssign<u64> for usize
source§fn shl_assign(&mut self, other: u64)
fn shl_assign(&mut self, other: u64)
<<=
operation. Read more1.8.0 · source§impl ShlAssign<u8> for usize
impl ShlAssign<u8> for usize
source§fn shl_assign(&mut self, other: u8)
fn shl_assign(&mut self, other: u8)
<<=
operation. Read more1.8.0 · source§impl ShlAssign for usize
impl ShlAssign for usize
source§fn shl_assign(&mut self, other: usize)
fn shl_assign(&mut self, other: usize)
<<=
operation. Read more