Struct kitsune_p2p_dht::Loc

source ·
pub struct Loc(pub Wrapping<u32>);
Expand description

Type for representing a location that can wrap around a u32 dht arc

Tuple Fields§

§0: Wrapping<u32>

Implementations§

source§

impl DhtLocation

source

pub const MIN: DhtLocation = _

source

pub const MAX: DhtLocation = _

source

pub fn new(loc: u32) -> DhtLocation

source

pub fn as_u32(&self) -> u32

source

pub fn as_i64(&self) -> i64

Methods from Deref<Target = Wrapping<u32>>§

source

pub const MIN: Wrapping<usize> = _

source

pub const MAX: Wrapping<usize> = _

source

pub const BITS: u32 = 64u32

source

pub const MIN: Wrapping<u8> = _

source

pub const MAX: Wrapping<u8> = _

source

pub const BITS: u32 = 8u32

source

pub const MIN: Wrapping<u16> = _

source

pub const MAX: Wrapping<u16> = _

source

pub const BITS: u32 = 16u32

source

pub const MIN: Wrapping<u32> = _

source

pub const MAX: Wrapping<u32> = _

source

pub const BITS: u32 = 32u32

source

pub const MIN: Wrapping<u64> = _

source

pub const MAX: Wrapping<u64> = _

source

pub const BITS: u32 = 64u32

source

pub const MIN: Wrapping<u128> = _

source

pub const MAX: Wrapping<u128> = _

source

pub const BITS: u32 = 128u32

source

pub const MIN: Wrapping<isize> = _

source

pub const MAX: Wrapping<isize> = _

source

pub const BITS: u32 = 64u32

source

pub const MIN: Wrapping<i8> = _

source

pub const MAX: Wrapping<i8> = _

source

pub const BITS: u32 = 8u32

source

pub const MIN: Wrapping<i16> = _

source

pub const MAX: Wrapping<i16> = _

source

pub const BITS: u32 = 16u32

source

pub const MIN: Wrapping<i32> = _

source

pub const MAX: Wrapping<i32> = _

source

pub const BITS: u32 = 32u32

source

pub const MIN: Wrapping<i64> = _

source

pub const MAX: Wrapping<i64> = _

source

pub const BITS: u32 = 64u32

source

pub const MIN: Wrapping<i128> = _

source

pub const MAX: Wrapping<i128> = _

source

pub const BITS: u32 = 128u32

Trait Implementations§

source§

impl Add for DhtLocation

§

type Output = DhtLocation

The resulting type after applying the + operator.
source§

fn add(self, rhs: DhtLocation) -> <DhtLocation as Add>::Output

Performs the + operation. Read more
source§

impl ArqStart for Loc

source§

fn to_loc(&self, _topo: &Topology, _power: u8) -> Loc

Get the DhtLocation representation
source§

fn to_offset(&self, topo: &Topology, power: u8) -> SpaceOffset

Get the exponential SpaceOffset representation
source§

fn requantize_up(&self, _factor: u32) -> Option<Self>

Requantize to a higher power, using the precalculated multiplicative factor.
source§

fn requantize_down(&self, _factor: u32) -> Self

Requantize to a lower power, using the precalculated multiplicative factor.
source§

impl AsPrimitive<u32> for DhtLocation

source§

fn as_(self) -> u32

Convert a value to another, using the as operator.
source§

impl AsRef<Wrapping<u32>> for DhtLocation

source§

fn as_ref(&self) -> &Wrapping<u32>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for DhtLocation

source§

fn clone(&self) -> DhtLocation

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DhtLocation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Deref for DhtLocation

§

type Target = Wrapping<u32>

The resulting type after dereferencing.
source§

fn deref(&self) -> &<DhtLocation as Deref>::Target

Dereferences the value.
source§

impl<'de> Deserialize<'de> for DhtLocation

source§

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
source§

impl Display for DhtLocation

source§

fn fmt( &self, _derive_more_display_formatter: &mut Formatter<'_> ) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Div for DhtLocation

§

type Output = DhtLocation

The resulting type after applying the / operator.
source§

fn div(self, rhs: DhtLocation) -> <DhtLocation as Div>::Output

Performs the / operation. Read more
source§

impl From<DhtLocation> for Wrapping<u32>

source§

fn from(original: DhtLocation) -> Wrapping<u32>

Converts to this type from the input type.
source§

impl From<DhtLocation> for u32

source§

fn from(l: DhtLocation) -> u32

Converts to this type from the input type.
source§

impl From<Wrapping<u32>> for DhtLocation

source§

fn from(original: Wrapping<u32>) -> DhtLocation

Converts to this type from the input type.
source§

impl From<u32> for DhtLocation

source§

fn from(a: u32) -> DhtLocation

Converts to this type from the input type.
source§

impl Hash for DhtLocation

source§

fn hash<__H>(&self, state: &mut __H)where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Mul for DhtLocation

§

type Output = DhtLocation

The resulting type after applying the * operator.
source§

fn mul(self, rhs: DhtLocation) -> <DhtLocation as Mul>::Output

Performs the * operation. Read more
source§

impl Num for DhtLocation

§

type FromStrRadixErr = <u32 as Num>::FromStrRadixErr

source§

fn from_str_radix( str: &str, radix: u32 ) -> Result<DhtLocation, <DhtLocation as Num>::FromStrRadixErr>

Convert from a string and radix (typically 2..=36). Read more
source§

impl One for DhtLocation

source§

fn one() -> DhtLocation

Returns the multiplicative identity element of Self, 1. Read more
source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
source§

fn is_one(&self) -> boolwhere Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
source§

impl Ord for DhtLocation

source§

fn cmp(&self, other: &DhtLocation) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for DhtLocation

source§

fn eq(&self, other: &DhtLocation) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for DhtLocation

source§

fn partial_cmp(&self, other: &DhtLocation) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Rem for DhtLocation

§

type Output = DhtLocation

The resulting type after applying the % operator.
source§

fn rem(self, rhs: DhtLocation) -> <DhtLocation as Rem>::Output

Performs the % operation. Read more
source§

impl Serialize for DhtLocation

source§

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
source§

impl Sub for DhtLocation

§

type Output = DhtLocation

The resulting type after applying the - operator.
source§

fn sub(self, rhs: DhtLocation) -> <DhtLocation as Sub>::Output

Performs the - operation. Read more
source§

impl Width for DhtLocation

§

type Output = u32

source§

fn max_value() -> DhtLocation

source§

fn min_value() -> DhtLocation

source§

fn width( lower: &DhtLocation, upper: &DhtLocation ) -> <DhtLocation as Width>::Output

The result might be infinite depending on the underlying type (think about floating types).
source§

impl Zero for DhtLocation

source§

fn zero() -> DhtLocation

Returns the additive identity element of Self, 0. Read more
source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
source§

impl Copy for DhtLocation

source§

impl Eq for DhtLocation

source§

impl StructuralEq for DhtLocation

source§

impl StructuralPartialEq for DhtLocation

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> Scalar for Twhere T: Copy + PartialEq + Debug + Any,

source§

fn inlined_clone(&self) -> T

Performance hack: Clone doesn’t get inlined for Copy types in debug mode, so make it inline anyway.
source§

fn is<T>() -> boolwhere T: Scalar,

Tests if Self the same as the type T Read more
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<Bound> ToInterval<Bound> for Boundwhere Bound: Width + Num,

source§

fn to_interval(self) -> Interval<Bound>

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for Twhere T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,