Enum kitsune_p2p_dht_arc::ArcInterval
source · [−]Expand description
An alternate implementation of ArcRange
Variants
Empty
Full
Bounded(u32, u32)
Implementations
sourceimpl ArcInterval
impl ArcInterval
pub fn new(start: u32, end: u32) -> Self
pub fn from_bounds(bounds: (u32, u32)) -> Self
pub fn contains<B: Borrow<u32>>(&self, t: B) -> bool
sourcepub fn quantized(&self) -> Self
pub fn quantized(&self) -> Self
Shift the bounds so that an integer half-length is achieved. Always increase the half-length, so that the resulting quantized interval is a superset of the original
Trait Implementations
sourceimpl Clone for ArcInterval
impl Clone for ArcInterval
sourcefn clone(&self) -> ArcInterval
fn clone(&self) -> ArcInterval
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 more
sourceimpl Debug for ArcInterval
impl Debug for ArcInterval
sourceimpl<'de> Deserialize<'de> for ArcInterval
impl<'de> Deserialize<'de> for ArcInterval
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<&'_ ArcInterval> for DhtArcSet
impl From<&'_ ArcInterval> for DhtArcSet
sourcefn from(arc: &ArcInterval) -> Self
fn from(arc: &ArcInterval) -> Self
Performs the conversion.
sourceimpl From<ArcInterval> for DhtArcSet
impl From<ArcInterval> for DhtArcSet
sourcefn from(arc: ArcInterval) -> Self
fn from(arc: ArcInterval) -> Self
Performs the conversion.
sourceimpl PartialEq<ArcInterval> for ArcInterval
impl PartialEq<ArcInterval> for ArcInterval
sourcefn eq(&self, other: &ArcInterval) -> bool
fn eq(&self, other: &ArcInterval) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ArcInterval) -> bool
fn ne(&self, other: &ArcInterval) -> bool
This method tests for !=
.
sourceimpl Serialize for ArcInterval
impl Serialize for ArcInterval
impl Eq for ArcInterval
impl StructuralEq for ArcInterval
impl StructuralPartialEq for ArcInterval
Auto Trait Implementations
impl RefUnwindSafe for ArcInterval
impl Send for ArcInterval
impl Sync for ArcInterval
impl Unpin for ArcInterval
impl UnwindSafe for ArcInterval
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more