Struct holochain::prelude::dependencies::kitsune_p2p_types::dht::prelude::Loc
Expand description
Type for representing a location that can wrap around a u32 dht arc
Tuple Fields
0: Wrapping<u32>
Implementations
impl DhtLocation
impl DhtLocation
pub const MIN: DhtLocation = Self(Wrapping(u32::MIN))
pub const MAX: DhtLocation = Self(Wrapping(u32::MAX))
pub fn new(loc: u32) -> DhtLocation
pub fn as_u32(&self) -> u32
pub fn as_i64(&self) -> i64
pub fn as_i32(&self) -> i32
impl DhtLocation
impl DhtLocation
Methods from Deref<Target = Wrapping<u32>>
pub const MIN: Wrapping<usize> = Self(usize::MIN)
pub const MAX: Wrapping<usize> = Self(usize::MAX)
pub const BITS: u32 = 64u32
pub const MIN: Wrapping<u8> = Self(u8::MIN)
pub const MAX: Wrapping<u8> = Self(u8::MAX)
pub const BITS: u32 = 8u32
pub const MIN: Wrapping<u16> = Self(u16::MIN)
pub const MAX: Wrapping<u16> = Self(u16::MAX)
pub const BITS: u32 = 16u32
pub const MIN: Wrapping<u32> = Self(u32::MIN)
pub const MAX: Wrapping<u32> = Self(u32::MAX)
pub const BITS: u32 = 32u32
pub const MIN: Wrapping<u64> = Self(u64::MIN)
pub const MAX: Wrapping<u64> = Self(u64::MAX)
pub const BITS: u32 = 64u32
pub const MIN: Wrapping<u128> = Self(u128::MIN)
pub const MAX: Wrapping<u128> = Self(u128::MAX)
pub const BITS: u32 = 128u32
pub const MIN: Wrapping<isize> = Self(isize::MIN)
pub const MAX: Wrapping<isize> = Self(isize::MAX)
pub const BITS: u32 = 64u32
pub const MIN: Wrapping<i8> = Self(i8::MIN)
pub const MAX: Wrapping<i8> = Self(i8::MAX)
pub const BITS: u32 = 8u32
pub const MIN: Wrapping<i16> = Self(i16::MIN)
pub const MAX: Wrapping<i16> = Self(i16::MAX)
pub const BITS: u32 = 16u32
pub const MIN: Wrapping<i32> = Self(i32::MIN)
pub const MAX: Wrapping<i32> = Self(i32::MAX)
pub const BITS: u32 = 32u32
Trait Implementations
impl Add<DhtLocation> for DhtLocation
impl Add<DhtLocation> for DhtLocation
type Output = DhtLocation
type Output = DhtLocation
The resulting type after applying the
+
operator.fn add(self, rhs: DhtLocation) -> <DhtLocation as Add<DhtLocation>>::Output
fn add(self, rhs: DhtLocation) -> <DhtLocation as Add<DhtLocation>>::Output
Performs the
+
operation. Read moreimpl ArqStart for DhtLocation
impl ArqStart for DhtLocation
fn to_loc(&self, _topo: &Topology, _power: u8) -> DhtLocation
fn to_loc(&self, _topo: &Topology, _power: u8) -> DhtLocation
Get the DhtLocation representation
fn to_offset(&self, topo: &Topology, power: u8) -> SpaceOffset
fn to_offset(&self, topo: &Topology, power: u8) -> SpaceOffset
Get the exponential SpaceOffset representation
fn requantize_up(&self, _factor: u32) -> Option<DhtLocation>
fn requantize_up(&self, _factor: u32) -> Option<DhtLocation>
Requantize to a higher power, using the precalculated multiplicative factor.
fn requantize_down(&self, _factor: u32) -> DhtLocation
fn requantize_down(&self, _factor: u32) -> DhtLocation
Requantize to a lower power, using the precalculated multiplicative factor.
impl AsPrimitive<u32> for DhtLocation
impl AsPrimitive<u32> for DhtLocation
impl AsRef<Wrapping<u32>> for DhtLocation
impl AsRef<Wrapping<u32>> for DhtLocation
impl Clone for DhtLocation
impl Clone for DhtLocation
fn clone(&self) -> DhtLocation
fn clone(&self) -> DhtLocation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl Debug for DhtLocation
impl Debug for DhtLocation
impl Deref for DhtLocation
impl Deref for DhtLocation
impl<'de> Deserialize<'de> for DhtLocation
impl<'de> Deserialize<'de> for DhtLocation
fn deserialize<__D>(
__deserializer: __D
) -> Result<DhtLocation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<DhtLocation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Display for DhtLocation
impl Display for DhtLocation
impl Div<DhtLocation> for DhtLocation
impl Div<DhtLocation> for DhtLocation
type Output = DhtLocation
type Output = DhtLocation
The resulting type after applying the
/
operator.fn div(self, rhs: DhtLocation) -> <DhtLocation as Div<DhtLocation>>::Output
fn div(self, rhs: DhtLocation) -> <DhtLocation as Div<DhtLocation>>::Output
Performs the
/
operation. Read moreimpl From<DhtLocation> for Wrapping<u32>
impl From<DhtLocation> for Wrapping<u32>
fn from(original: DhtLocation) -> Wrapping<u32>
fn from(original: DhtLocation) -> Wrapping<u32>
Converts to this type from the input type.
impl From<DhtLocation> for u32
impl From<DhtLocation> for u32
fn from(l: DhtLocation) -> u32
fn from(l: DhtLocation) -> u32
Converts to this type from the input type.
impl From<Loc8> for DhtLocation
impl From<Loc8> for DhtLocation
fn from(i: Loc8) -> DhtLocation
fn from(i: Loc8) -> DhtLocation
Converts to this type from the input type.
impl From<Wrapping<u32>> for DhtLocation
impl From<Wrapping<u32>> for DhtLocation
fn from(original: Wrapping<u32>) -> DhtLocation
fn from(original: Wrapping<u32>) -> DhtLocation
Converts to this type from the input type.
impl From<i32> for DhtLocation
impl From<i32> for DhtLocation
fn from(i: i32) -> DhtLocation
fn from(i: i32) -> DhtLocation
Converts to this type from the input type.
impl From<u32> for DhtLocation
impl From<u32> for DhtLocation
fn from(a: u32) -> DhtLocation
fn from(a: u32) -> DhtLocation
Converts to this type from the input type.
impl Hash for DhtLocation
impl Hash for DhtLocation
impl Mul<DhtLocation> for DhtLocation
impl Mul<DhtLocation> for DhtLocation
type Output = DhtLocation
type Output = DhtLocation
The resulting type after applying the
*
operator.fn mul(self, rhs: DhtLocation) -> <DhtLocation as Mul<DhtLocation>>::Output
fn mul(self, rhs: DhtLocation) -> <DhtLocation as Mul<DhtLocation>>::Output
Performs the
*
operation. Read moreimpl Num for DhtLocation
impl Num for DhtLocation
type FromStrRadixErr = <u32 as Num>::FromStrRadixErr
fn from_str_radix(
str: &str,
radix: u32
) -> Result<DhtLocation, <DhtLocation as Num>::FromStrRadixErr>
fn from_str_radix(
str: &str,
radix: u32
) -> Result<DhtLocation, <DhtLocation as Num>::FromStrRadixErr>
Convert from a string and radix (typically
2..=36
). Read moreimpl One for DhtLocation
impl One for DhtLocation
fn one() -> DhtLocation
fn one() -> DhtLocation
impl Ord for DhtLocation
impl Ord for DhtLocation
fn cmp(&self, other: &DhtLocation) -> Ordering
fn cmp(&self, other: &DhtLocation) -> Ordering
1.21.0 · sourcefn 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
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
impl PartialEq<DhtLocation> for DhtLocation
impl PartialEq<DhtLocation> for DhtLocation
fn eq(&self, other: &DhtLocation) -> bool
fn eq(&self, other: &DhtLocation) -> bool
impl PartialOrd<DhtLocation> for DhtLocation
impl PartialOrd<DhtLocation> for DhtLocation
fn partial_cmp(&self, other: &DhtLocation) -> Option<Ordering>
fn partial_cmp(&self, other: &DhtLocation) -> Option<Ordering>
1.0.0 · sourcefn 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 Rem<DhtLocation> for DhtLocation
impl Rem<DhtLocation> for DhtLocation
type Output = DhtLocation
type Output = DhtLocation
The resulting type after applying the
%
operator.fn rem(self, rhs: DhtLocation) -> <DhtLocation as Rem<DhtLocation>>::Output
fn rem(self, rhs: DhtLocation) -> <DhtLocation as Rem<DhtLocation>>::Output
Performs the
%
operation. Read moreimpl Serialize for DhtLocation
impl Serialize for DhtLocation
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Sub<DhtLocation> for DhtLocation
impl Sub<DhtLocation> for DhtLocation
type Output = DhtLocation
type Output = DhtLocation
The resulting type after applying the
-
operator.fn sub(self, rhs: DhtLocation) -> <DhtLocation as Sub<DhtLocation>>::Output
fn sub(self, rhs: DhtLocation) -> <DhtLocation as Sub<DhtLocation>>::Output
Performs the
-
operation. Read moreimpl ToSql for DhtLocation
impl ToSql for DhtLocation
fn to_sql(&self) -> Result<ToSqlOutput<'_>, Error>
fn to_sql(&self) -> Result<ToSqlOutput<'_>, Error>
Converts Rust value to SQLite value
impl Width for DhtLocation
impl Width for DhtLocation
type Output = u32
fn max_value() -> DhtLocation
fn min_value() -> DhtLocation
fn width(
lower: &DhtLocation,
upper: &DhtLocation
) -> <DhtLocation as Width>::Output
fn width(
lower: &DhtLocation,
upper: &DhtLocation
) -> <DhtLocation as Width>::Output
The result might be infinite depending on the underlying type (think about floating types).
impl Zero for DhtLocation
impl Zero for DhtLocation
impl Copy for DhtLocation
impl Eq for DhtLocation
impl StructuralEq for DhtLocation
impl StructuralPartialEq for DhtLocation
Auto Trait Implementations
impl RefUnwindSafe for DhtLocation
impl Send for DhtLocation
impl Sync for DhtLocation
impl Unpin for DhtLocation
impl UnwindSafe for DhtLocation
Blanket Implementations
impl<T> Any for Twhere
T: Any + ?Sized,
impl<T> Any for Twhere
T: Any + ?Sized,
fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove
Any::type_id_compat and use StdAny::type_id instead.
https://github.com/rust-lang/rust/issues/27745 Read more
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.impl<T> FutureExt for T
impl<T> FutureExt for T
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
sourcefn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
sourcefn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read morefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.impl<Bound> ToInterval<Bound> for Boundwhere
Bound: Width + Num,
impl<Bound> ToInterval<Bound> for Boundwhere
Bound: Width + Num,
fn to_interval(self) -> Interval<Bound>
impl<T> Upcastable for Twhere
T: 'static + Any + Send + Sync,
impl<T> Upcastable for Twhere
T: 'static + Any + Send + Sync,
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref