Struct kitsune_p2p_dht_arc::DhtLocation

source ·
pub struct DhtLocation(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: Self = _

source

pub const MAX: Self = _

source

pub fn new(loc: u32) -> Self

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: Self) -> Self::Output

Performs the + operation. Read more
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

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) -> &Self::Target

Dereferences the value.
source§

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

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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

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: Self) -> Self::Output

Performs the / operation. Read more
source§

impl From<DhtLocation> for Wrapping<u32>

source§

fn from(original: DhtLocation) -> Self

Converts to this type from the input type.
source§

impl From<DhtLocation> for u32

source§

fn from(l: DhtLocation) -> Self

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) -> Self

Converts to this type from the input type.
source§

impl Hash for DhtLocation

source§

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

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: Self) -> Self::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<Self, Self::FromStrRadixErr>

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

impl One for DhtLocation

source§

fn one() -> Self

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) -> bool
where 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) -> Self
where Self: Sized,

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

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

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

fn clamp(self, min: Self, max: Self) -> Self
where 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: Self) -> Self::Output

Performs the % operation. Read more
source§

impl Serialize for DhtLocation

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::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: Self) -> Self::Output

Performs the - operation. Read more
source§

impl Width for DhtLocation

§

type Output = u32

source§

fn max_value() -> Self

source§

fn min_value() -> Self

source§

fn width(lower: &Self, upper: &Self) -> Self::Output

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

impl Zero for DhtLocation

source§

fn zero() -> Self

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 StructuralPartialEq for DhtLocation

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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, U> Into<U> for T
where 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<Bound> ToInterval<Bound> for Bound
where Bound: Width + Num,

source§

fn to_interval(self) -> Interval<Bound>

source§

impl<T> ToOwned for T
where 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 T
where 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 T
where 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 T
where 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.
source§

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

source§

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