Struct diesel_mysql_spatial::data_types::BoundingBox
source · [−]Expand description
An axis-aligned bounding rectangle.
MySQL doesn’t support native Rects. Corresponding functions like ST_Envelope() return
a Polygon of the shape POLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))
instead. This struct exists to provide more convenient access to the coordinates if your
column always contains such polygons.
Warning: This can only be unserialized from a Polygon
column. If polygons in other shapes are unserialized, the process may either fail
or silently result in wrong bounds.
MySQL extension: The spatial reference system identifier (SRID) may identify the used coordinate system.
Fields
srid: SRIDgeom: Rect<f64>Methods from Deref<Target = Rect<f64>>
sourcepub fn set_min<C>(&mut self, min: C) where
C: Into<Coordinate<T>>,
pub fn set_min<C>(&mut self, min: C) where
C: Into<Coordinate<T>>,
Set the Rect’s minimum coordinate.
Panics
Panics if min’s x/y is greater than the maximum coordinate’s x/y.
sourcepub fn set_max<C>(&mut self, max: C) where
C: Into<Coordinate<T>>,
pub fn set_max<C>(&mut self, max: C) where
C: Into<Coordinate<T>>,
Set the Rect’s maximum coordinate.
Panics
Panics if max’s x/y is less than the minimum coordinate’s x/y.
pub fn to_lines(&self) -> [Line<T>; 4]
Trait Implementations
sourceimpl AsMut<Rect<f64>> for BoundingBox
impl AsMut<Rect<f64>> for BoundingBox
sourceimpl AsRef<Rect<f64>> for BoundingBox
impl AsRef<Rect<f64>> for BoundingBox
sourceimpl Clone for BoundingBox
impl Clone for BoundingBox
sourcefn clone(&self) -> BoundingBox
fn clone(&self) -> BoundingBox
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for BoundingBox
impl Debug for BoundingBox
sourceimpl Deref for BoundingBox
impl Deref for BoundingBox
sourceimpl DerefMut for BoundingBox
impl DerefMut for BoundingBox
sourceimpl From<BoundingBox> for Geometry
impl From<BoundingBox> for Geometry
sourcefn from(other: BoundingBox) -> Self
fn from(other: BoundingBox) -> Self
Converts to this type from the input type.
sourceimpl From<BoundingBox> for Polygon
impl From<BoundingBox> for Polygon
sourcefn from(other: BoundingBox) -> Self
fn from(other: BoundingBox) -> Self
Converts to this type from the input type.
sourceimpl From<Rect<f64>> for BoundingBox
impl From<Rect<f64>> for BoundingBox
sourceimpl FromSql<Polygon, Mysql> for BoundingBox
impl FromSql<Polygon, Mysql> for BoundingBox
sourceimpl<__ST, __DB> FromSqlRow<__ST, __DB> for BoundingBox where
__DB: Backend,
Self: FromSql<__ST, __DB>,
impl<__ST, __DB> FromSqlRow<__ST, __DB> for BoundingBox where
__DB: Backend,
Self: FromSql<__ST, __DB>,
sourcefn build_from_row<R: Row<__DB>>(row: &mut R) -> Result<Self>
fn build_from_row<R: Row<__DB>>(row: &mut R) -> Result<Self>
See the trait documentation.
sourceconst FIELDS_NEEDED: usize = 1usize
const FIELDS_NEEDED: usize = 1usize
The number of fields that this type will consume. Must be equal to
the number of times you would call row.take() in build_from_row Read more
sourceimpl PartialEq<BoundingBox> for BoundingBox
impl PartialEq<BoundingBox> for BoundingBox
sourcefn eq(&self, other: &BoundingBox) -> bool
fn eq(&self, other: &BoundingBox) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &BoundingBox) -> bool
fn ne(&self, other: &BoundingBox) -> bool
This method tests for !=.
sourceimpl<__ST, __DB> Queryable<__ST, __DB> for BoundingBox where
__DB: Backend,
Self: FromSql<__ST, __DB>,
impl<__ST, __DB> Queryable<__ST, __DB> for BoundingBox where
__DB: Backend,
Self: FromSql<__ST, __DB>,
sourceimpl ToSql<Polygon, Mysql> for BoundingBox
impl ToSql<Polygon, Mysql> for BoundingBox
impl StructuralPartialEq for BoundingBox
Auto Trait Implementations
impl RefUnwindSafe for BoundingBox
impl Send for BoundingBox
impl Sync for BoundingBox
impl Unpin for BoundingBox
impl UnwindSafe for BoundingBox
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> IntoSql for T
impl<T> IntoSql for T
sourcefn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
Convert self to an expression for Diesel’s query builder. Read more
sourcefn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
Convert &self to an expression for Diesel’s query builder. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more