Struct shapefile::record::point::Point

source ·
pub struct Point {
    pub x: f64,
    pub y: f64,
}
Expand description

Point with only x and y coordinates

Fields§

§x: f64§y: f64

Implementations§

source§

impl Point

source

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

Creates a new point

§Examples
use shapefile::Point;
let point = Point::new(1.0, 42.0);
assert_eq!(point.x, 1.0);
assert_eq!(point.y, 42.0);
use shapefile::Point;
let point = Point::default();
assert_eq!(point.x, 0.0);
assert_eq!(point.y, 0.0);

Trait Implementations§

source§

impl Clone for Point

source§

fn clone(&self) -> Point

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 Point

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 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() -> Point

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

impl Display for Point

source§

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

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

impl EsriShape for Point

source§

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

source§

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

source§

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

Should return the Z range of this shape
source§

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

Should return the M range of this shape
source§

impl From<Coord> for Point

source§

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

Converts to this type from the input type.
source§

impl From<Point> for Coordinate<f64>

source§

fn from(p: Point) -> Self

Converts to this type from the input type.
source§

impl From<Point> for Point

source§

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

Converts to this type from the input type.
source§

impl From<Point> for Point<f64>

source§

fn from(p: Point) -> Self

Converts to this type from the input type.
source§

impl From<Point> for Shape

source§

fn from(concrete: Point) -> Self

Converts to this type from the input type.
source§

impl GrowablePoint for Point

source§

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

source§

impl HasShapeType for Point

source§

fn shapetype() -> ShapeType

Returns the ShapeType
source§

impl HasXY for Point

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 Point

source§

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

impl ShrinkablePoint for Point

source§

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

source§

impl TryFrom<Shape> for Point

§

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 Point

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 Point

source§

impl Copy for Point

source§

impl StructuralPartialEq for Point

Auto Trait Implementations§

§

impl Freeze for Point

§

impl RefUnwindSafe for Point

§

impl Send for Point

§

impl Sync for Point

§

impl Unpin 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<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> 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> ToOwned for T
where T: Clone,

§

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§

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

§

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

§

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.