pub struct BoundingBox {
pub srid: SRID,
pub geom: Rect<f64>,
}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: SRID§geom: Rect<f64>Methods from Deref<Target = Rect<f64>>§
Sourcepub fn set_min<C>(&mut self, min: C)
pub fn set_min<C>(&mut self, min: C)
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)
pub fn set_max<C>(&mut self, max: C)
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§
Source§impl AsMut<Rect> for BoundingBox
impl AsMut<Rect> for BoundingBox
Source§impl AsRef<Rect> for BoundingBox
impl AsRef<Rect> for BoundingBox
Source§impl Clone for BoundingBox
impl Clone for BoundingBox
Source§fn clone(&self) -> BoundingBox
fn clone(&self) -> BoundingBox
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BoundingBox
impl Debug for BoundingBox
Source§impl Deref for BoundingBox
impl Deref for BoundingBox
Source§impl DerefMut for BoundingBox
impl DerefMut for BoundingBox
Source§impl From<BoundingBox> for Geometry
impl From<BoundingBox> for Geometry
Source§fn from(other: BoundingBox) -> Self
fn from(other: BoundingBox) -> Self
Source§impl From<BoundingBox> for Polygon
impl From<BoundingBox> for Polygon
Source§fn from(other: BoundingBox) -> Self
fn from(other: BoundingBox) -> Self
Source§impl From<Rect> for BoundingBox
impl From<Rect> for BoundingBox
Source§impl<__ST, __DB> FromSqlRow<__ST, __DB> for BoundingBox
impl<__ST, __DB> FromSqlRow<__ST, __DB> for BoundingBox
Source§const FIELDS_NEEDED: usize = 1usize
const FIELDS_NEEDED: usize = 1usize
row.take() in build_from_rowSource§impl PartialEq for BoundingBox
impl PartialEq for BoundingBox
Source§impl<__ST, __DB> Queryable<__ST, __DB> for BoundingBox
impl<__ST, __DB> Queryable<__ST, __DB> for BoundingBox
impl StructuralPartialEq for BoundingBox
Auto Trait Implementations§
impl Freeze for BoundingBox
impl RefUnwindSafe for BoundingBox
impl Send for BoundingBox
impl Sync for BoundingBox
impl Unpin for BoundingBox
impl UnwindSafe for BoundingBox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
&self to an expression for Diesel’s query builder. Read more