Type Alias holochain::prelude::kitsune_p2p::dependencies::kitsune_p2p_types::dht::prelude::TimeSegment
pub type TimeSegment = Segment<TimeOffset>;
Expand description
Alias
Aliased Type§
struct TimeSegment {
pub power: u8,
pub offset: TimeOffset,
}
Fields§
§power: u8
The exponent, where length = 2^power
offset: TimeOffset
The offset from the origin, measured in number of lengths
Implementations§
§impl<O> Segment<O>where
O: Offset,
impl<O> Segment<O>where O: Offset,
pub fn num_quanta(&self) -> u64
pub fn num_quanta(&self) -> u64
How many quanta does this segment cover?
pub fn absolute_length(&self, topo: &Topology) -> u64
pub fn absolute_length(&self, topo: &Topology) -> u64
The length, in absolute terms (Location or microseconds of time)
pub fn quantum_bounds(
&self,
topo: &Topology
) -> (<O as Offset>::Quantum, <O as Offset>::Quantum)
pub fn quantum_bounds( &self, topo: &Topology ) -> (<O as Offset>::Quantum, <O as Offset>::Quantum)
Get the quanta which bound this segment
pub fn contains_quantum(
&self,
topo: &Topology,
coord: <O as Offset>::Quantum
) -> bool
pub fn contains_quantum( &self, topo: &Topology, coord: <O as Offset>::Quantum ) -> bool
The segment contains the given quantum coord
§impl Segment<TimeOffset>
impl Segment<TimeOffset>
pub fn timestamp_bounds(&self, topo: &Topology) -> (Timestamp, Timestamp)
pub fn timestamp_bounds(&self, topo: &Topology) -> (Timestamp, Timestamp)
Get the start and end bounds, in absolute Timestamp coordinates, for this segment
Trait Implementations§
§impl<'de, O> Deserialize<'de> for Segment<O>where
O: Offset + Deserialize<'de>,
impl<'de, O> Deserialize<'de> for Segment<O>where O: Offset + Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D
) -> Result<Segment<O>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Segment<O>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<O> Ord for Segment<O>where
O: Ord + Offset,
impl<O> Ord for Segment<O>where O: Ord + Offset,
§impl<O> PartialEq<Segment<O>> for Segment<O>where
O: PartialEq<O> + Offset,
impl<O> PartialEq<Segment<O>> for Segment<O>where O: PartialEq<O> + Offset,
§impl<O> PartialOrd<Segment<O>> for Segment<O>where
O: PartialOrd<O> + Offset,
impl<O> PartialOrd<Segment<O>> for Segment<O>where O: PartialOrd<O> + Offset,
§fn partial_cmp(&self, other: &Segment<O>) -> Option<Ordering>
fn partial_cmp(&self, other: &Segment<O>) -> 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 more§impl<O> Serialize for Segment<O>where
O: Offset + Serialize,
impl<O> Serialize for Segment<O>where O: Offset + Serialize,
§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