pub enum MaybeInfiniteInt {
NegInfinity,
Finite(u128),
PosInfinity,
}
Expand description
A possibly infinite integer. Values are encoded such that the ordering on u128
matches the
natural order on the original type. For example, -128i8
is encoded as 0
and 127i8
as
255
. See signed_bias
for details.
Variants§
NegInfinity
Finite(u128)
Encoded value. DO NOT CONSTRUCT BY HAND; use new_finite_{int,uint}
.
PosInfinity
Implementations§
source§impl MaybeInfiniteInt
impl MaybeInfiniteInt
pub fn new_finite_uint(bits: u128) -> Self
pub fn new_finite_int(bits: u128, size: u64) -> Self
pub fn as_finite_uint(self) -> Option<u128>
pub fn as_finite_int(self, size: u64) -> Option<u128>
Trait Implementations§
source§impl Clone for MaybeInfiniteInt
impl Clone for MaybeInfiniteInt
source§fn clone(&self) -> MaybeInfiniteInt
fn clone(&self) -> MaybeInfiniteInt
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MaybeInfiniteInt
impl Debug for MaybeInfiniteInt
source§impl Ord for MaybeInfiniteInt
impl Ord for MaybeInfiniteInt
source§fn cmp(&self, other: &MaybeInfiniteInt) -> Ordering
fn cmp(&self, other: &MaybeInfiniteInt) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for MaybeInfiniteInt
impl PartialEq for MaybeInfiniteInt
source§fn eq(&self, other: &MaybeInfiniteInt) -> bool
fn eq(&self, other: &MaybeInfiniteInt) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for MaybeInfiniteInt
impl PartialOrd for MaybeInfiniteInt
source§fn partial_cmp(&self, other: &MaybeInfiniteInt) -> Option<Ordering>
fn partial_cmp(&self, other: &MaybeInfiniteInt) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for MaybeInfiniteInt
impl Eq for MaybeInfiniteInt
impl StructuralPartialEq for MaybeInfiniteInt
Auto Trait Implementations§
impl DynSend for MaybeInfiniteInt
impl DynSync for MaybeInfiniteInt
impl Freeze for MaybeInfiniteInt
impl RefUnwindSafe for MaybeInfiniteInt
impl Send for MaybeInfiniteInt
impl Sync for MaybeInfiniteInt
impl Unpin for MaybeInfiniteInt
impl UnwindSafe for MaybeInfiniteInt
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
source§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on<'a>(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter<'a>( arena: &'a Arena<'tcx>, iter: impl IntoIterator<Item = T> ) -> &'a mut [T]
source§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on<'a>(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter<'a>( arena: &'a Arena<'tcx>, iter: impl IntoIterator<Item = T> ) -> &'a mut [T]
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Filterable for T
impl<T> Filterable for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<'tcx, T> ToPredicate<'tcx, T> for T
impl<'tcx, T> ToPredicate<'tcx, T> for T
fn to_predicate(self, _tcx: TyCtxt<'tcx>) -> T
source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed ) -> T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes
Size for each variant:
NegInfinity
: 0 bytesFinite
: 16 bytesPosInfinity
: 0 bytes