pub type SpaceSegment = Segment<SpaceOffset>;
Expand description

Alias

Aliased Type§

struct SpaceSegment {
    pub power: u8,
    pub offset: SpaceOffset,
}

Fields§

§power: u8

The exponent, where length = 2^power

§offset: SpaceOffset

The offset from the origin, measured in number of lengths

Implementations§

§

impl<O> Segment<O>where O: Offset,

pub fn new<OO>(power: u8, offset: OO) -> Segment<O>where OO: Into<O>,

Constructor

pub fn num_quanta(&self) -> u64

How many quanta does this segment cover?

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)

Get the quanta which bound this segment

pub fn contains_quantum( &self, topo: &Topology, coord: <O as Offset>::Quantum ) -> bool

The segment contains the given quantum coord

pub fn bisect(&self) -> Option<[Segment<O>; 2]>

Split a segment in half

§

impl Segment<SpaceOffset>

pub fn loc_bounds(&self, topo: &Topology) -> (DhtLocation, DhtLocation)

Get the start and end bounds, in absolute Loc coordinates, for this segment

Trait Implementations§

§

impl<O> Clone for Segment<O>where O: Clone + Offset,

§

fn clone(&self) -> Segment<O>

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
§

impl<O> Debug for Segment<O>where O: Debug + Offset,

§

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

Formats the value using the given formatter. Read more
§

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>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<O> Hash for Segment<O>where O: Hash + Offset,

§

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
§

impl<O> Ord for Segment<O>where O: Ord + Offset,

§

fn cmp(&self, other: &Segment<O>) -> 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<Self>,

Restrict a value to a certain interval. Read more
§

impl<O> PartialEq<Segment<O>> for Segment<O>where O: PartialEq<O> + Offset,

§

fn eq(&self, other: &Segment<O>) -> 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.
§

impl<O> PartialOrd<Segment<O>> for Segment<O>where O: PartialOrd<O> + Offset,

§

fn partial_cmp(&self, other: &Segment<O>) -> 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
§

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,

Serialize this value into the given Serde serializer. Read more
§

impl<O> Copy for Segment<O>where O: Copy + Offset,

§

impl<O> Eq for Segment<O>where O: Eq + Offset,

§

impl<O> StructuralEq for Segment<O>where O: Offset,

§

impl<O> StructuralPartialEq for Segment<O>where O: Offset,