Skip to main content

Point

Struct Point 

Source
pub struct Point {
    pub x: f64,
    pub y: f64,
    pub z: f64,
}
Expand description

A point in the network’s coordinate system, re-exported at this format’s own path. This is net’s crate::domain::Point, not a lookalike: the two used to be separate byte-identical structs only because additional cannot name a type from net, which may not be enabled, and both are now the one definition in a module that is always compiled. Unlike LaneRef below, nothing was gained by keeping them apart — see the type’s own docs. A point in the network’s coordinate system (meters), with an optional z represented here as 0.0 by default.

Default is the origin.

Shared by every format rather than defined once per format, unlike the id newtypes next to it. Those are per-format on purpose — an additional’s LaneRef and a net’s LaneId carry the same string but mean “a lane in the file I came with” and “a lane I define”, and keeping them un-mixable is worth the duplication. A point has no such reading: it is a pair of meters in one coordinate system, and net’s and additional’s were byte-identical structs that only existed separately because additional cannot name a type from net, which may not be enabled. This module is always compiled when any format is (see lib.rs), so it can hold the one definition both re-export — and with it, in Self::parse, the single copy of how SUMO spells a position. (Plain code span, not a link: parse is pub(crate), so an intra-doc link to it fails rustdoc::private_intra_doc_links under -D warnings.)

Fields§

§x: f64§y: f64§z: f64

Trait Implementations§

Source§

impl Clone for Point

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Point

Source§

impl Debug for Point

Source§

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

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

impl Default for Point

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Point

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Point

Source§

impl TryFrom<&str> for Point

Point::parse under the generic name, for the common case where “SUMO position” is context enough. Lives here beside the type rather than in a format’s schema_mapper so there is one impl of it, not one per format competing for the same impl TryFrom<&str> for Point.

Source§

type Error = Error

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

fn try_from(raw: &str) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

§

impl Freeze for Point

§

impl RefUnwindSafe for Point

§

impl Send for Point

§

impl Sync for Point

§

impl Unpin for Point

§

impl UnsafeUnpin for Point

§

impl UnwindSafe for Point

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<X> AsAny for X
where X: 'static,

Source§

fn into_any(self: Box<X>) -> Box<dyn Any>

Convert the boxed object into a boxed any.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Get a reference to the current object as Any.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Get a mutable reference to the current object as Any.
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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.