Struct PointM

Source
pub struct PointM {
    pub x: f64,
    pub y: f64,
    pub m: f64,
}
Expand description

Point with x, y, m

Fields§

§x: f64§y: f64§m: f64

Implementations§

Source§

impl PointM

Source

pub fn new(x: f64, y: f64, m: f64) -> Self

Creates a new pointM

§Examples
use shapefile::PointM;
let point = PointM::new(1.0, 42.0, 13.37);
assert_eq!(point.x, 1.0);
assert_eq!(point.y, 42.0);
assert_eq!(point.m, 13.37);
use shapefile::{PointM, NO_DATA};
let point = PointM::default();
assert_eq!(point.x, 0.0);
assert_eq!(point.y, 0.0);
assert_eq!(point.m, NO_DATA);

Trait Implementations§

Source§

impl Clone for PointM

Source§

fn clone(&self) -> PointM

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 ConcreteReadableShape for PointM

Source§

fn read_shape_content<T: Read>( source: &mut T, record_size: i32, ) -> Result<Self, Error>

Function that actually reads the ActualShape from the source and returns it
Source§

impl CoordTrait for &PointM

Source§

type T = f64

The coordinate type of this geometry
Source§

fn dim(&self) -> Dimensions

Dimensions of the coordinate tuple
Source§

fn nth_or_panic(&self, n: usize) -> Self::T

Access the n’th (0-based) element of the CoordinateTuple. May panic if n >= DIMENSION. See also nth().
Source§

fn x(&self) -> Self::T

x component of this coord.
Source§

fn y(&self) -> Self::T

y component of this coord.
Source§

fn nth(&self, n: usize) -> Option<Self::T>

Access the n’th (0-based) element of the CoordinateTuple. Returns None if n >= DIMENSION. Read more
Source§

fn x_y(&self) -> (Self::T, Self::T)

Returns a tuple that contains the x/horizontal & y/vertical component of the coord.
Source§

unsafe fn nth_unchecked(&self, n: usize) -> Self::T

Access the n’th (0-based) element of the CoordinateTuple. May panic if n >= DIMENSION. Read more
Source§

impl CoordTrait for PointM

Source§

type T = f64

The coordinate type of this geometry
Source§

fn dim(&self) -> Dimensions

Dimensions of the coordinate tuple
Source§

fn nth_or_panic(&self, n: usize) -> Self::T

Access the n’th (0-based) element of the CoordinateTuple. May panic if n >= DIMENSION. See also nth().
Source§

fn x(&self) -> Self::T

x component of this coord.
Source§

fn y(&self) -> Self::T

y component of this coord.
Source§

fn nth(&self, n: usize) -> Option<Self::T>

Access the n’th (0-based) element of the CoordinateTuple. Returns None if n >= DIMENSION. Read more
Source§

fn x_y(&self) -> (Self::T, Self::T)

Returns a tuple that contains the x/horizontal & y/vertical component of the coord.
Source§

unsafe fn nth_unchecked(&self, n: usize) -> Self::T

Access the n’th (0-based) element of the CoordinateTuple. May panic if n >= DIMENSION. Read more
Source§

impl Debug for PointM

Source§

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

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

impl Default for PointM

Source§

fn default() -> Self

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

impl Display for PointM

Source§

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

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

impl EsriShape for PointM

Source§

fn x_range(&self) -> [f64; 2]

Source§

fn y_range(&self) -> [f64; 2]

Source§

fn m_range(&self) -> [f64; 2]

Should return the M range of this shape
Source§

fn z_range(&self) -> [f64; 2]

Should return the Z range of this shape
Source§

impl From<Coord> for PointM

Source§

fn from(c: Coord<f64>) -> Self

Converts to this type from the input type.
Source§

impl From<Point> for PointM

Source§

fn from(p: Point<f64>) -> Self

Converts to this type from the input type.
Source§

impl From<PointM> for Coord<f64>

Source§

fn from(p: PointM) -> Self

Converts to this type from the input type.
Source§

impl From<PointM> for Point<f64>

Source§

fn from(p: PointM) -> Self

Converts to this type from the input type.
Source§

impl From<PointM> for Shape

Source§

fn from(concrete: PointM) -> Self

Converts to this type from the input type.
Source§

impl GrowablePoint for PointM

Source§

fn grow(&mut self, other: &Self)

Source§

impl HasM for PointM

Source§

fn m(&self) -> f64

Source§

impl HasShapeType for PointM

Source§

fn shapetype() -> ShapeType

Returns the ShapeType
Source§

impl HasXY for PointM

Source§

fn x(&self) -> f64

Returns the value of the x dimension
Source§

fn y(&self) -> f64

Returns the value of the y dimension
Source§

impl PartialEq for PointM

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PointTrait for &PointM

Source§

type T = f64

The coordinate type of this geometry
Source§

type CoordType<'a> = &'a PointM where Self: 'a

The type of the underlying coordinate, which implements CoordTrait
Source§

fn dim(&self) -> Dimensions

Dimensions of the coordinate tuple
Source§

fn coord(&self) -> Option<Self::CoordType<'_>>

The location of this 0-dimensional geometry. Read more
Source§

impl PointTrait for PointM

Source§

type T = f64

The coordinate type of this geometry
Source§

type CoordType<'a> = &'a PointM where Self: 'a

The type of the underlying coordinate, which implements CoordTrait
Source§

fn dim(&self) -> Dimensions

Dimensions of the coordinate tuple
Source§

fn coord(&self) -> Option<Self::CoordType<'_>>

The location of this 0-dimensional geometry. Read more
Source§

impl ShrinkablePoint for PointM

Source§

fn shrink(&mut self, other: &Self)

Source§

impl TryFrom<Shape> for PointM

Source§

type Error = Error

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

fn try_from(shape: Shape) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl WritableShape for PointM

Source§

fn size_in_bytes(&self) -> usize

Returns the size in bytes that the Shapes will take once written. Does not include the shapetype
Source§

fn write_to<T: Write>(&self, dest: &mut T) -> Result<(), Error>

Writes the shape to the dest
Source§

impl ConcreteShape for PointM

Source§

impl Copy for PointM

Source§

impl StructuralPartialEq for PointM

Auto Trait Implementations§

§

impl Freeze for PointM

§

impl RefUnwindSafe for PointM

§

impl Send for PointM

§

impl Sync for PointM

§

impl Unpin for PointM

§

impl UnwindSafe for PointM

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> 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<S> ReadableShape for S

Source§

fn read_from<T>(source: &mut T, record_size: i32) -> Result<S, Error>
where T: Read,

Source§

impl<T, G> ToGeoCoord<T> for G
where T: CoordNum, G: CoordTrait<T = T>,

Source§

fn to_coord(&self) -> Coord<T>

Convert to a geo_types Coord.
Source§

impl<T, G> ToGeoPoint<T> for G
where T: CoordNum, G: PointTrait<T = T>,

Source§

fn try_to_point(&self) -> Option<Point<T>>

Convert to a geo_types Point. Read more
Source§

fn to_point(&self) -> Point<T>

Convert to a geo_types Point. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

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

Source§

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

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.