Struct STBox

Source
pub struct STBox { /* private fields */ }

Implementations§

Source§

impl STBox

Source

pub fn inner(&self) -> *const STBox

Source

pub fn from_inner(inner: *mut STBox) -> Self

Source

pub fn from_geos(value: Geometry) -> Self

Source

pub fn geos_geometry(&self) -> Option<Geometry>

Source

pub fn expand_space(&self, value: f64) -> STBox

Trait Implementations§

Source§

impl Box for STBox

Source§

fn from_time<Tz: TimeZone>(time: DateTime<Tz>) -> Self

Creates an STBox from a DateTime value.

§Arguments
  • time - A DateTime<Tz> instance representing a timestamp.
§Returns

An STBox instance.

§Example
use meos::Box;
use chrono::{Utc, TimeZone};
let datetime = Utc.with_ymd_and_hms(2020, 5, 15, 12, 0, 0).unwrap();
let stbox = STBox::from_time(datetime);
assert_eq!(stbox.tmin().unwrap(), datetime);
Source§

fn from_wkb(wkb: &[u8]) -> Self

Source§

fn from_hexwkb(hexwkb: &[u8]) -> Self

Source§

fn from_temporal_span(span: TsTzSpan) -> Self

Source§

fn tstzspan(&self) -> TsTzSpan

Source§

fn as_wkb(&self, variant: WKBVariant) -> &[u8]

Source§

fn as_hexwkb(&self, variant: WKBVariant) -> &[u8]

Source§

fn has_x(&self) -> bool

Source§

fn has_t(&self) -> bool

Source§

fn xmin(&self) -> Option<f64>

Source§

fn xmax(&self) -> Option<f64>

Source§

fn tmin(&self) -> Option<DateTime<Utc>>

Source§

fn tmax(&self) -> Option<DateTime<Utc>>

Source§

fn is_tmin_inclusive(&self) -> Option<bool>

Source§

fn is_tmax_inclusive(&self) -> Option<bool>

Source§

fn expand_time(&self, duration: TimeDelta) -> STBox

Source§

fn shift_scale_time( &self, delta: Option<TimeDelta>, width: Option<TimeDelta>, ) -> STBox

Source§

fn round(&self, max_decimals: i32) -> STBox

Source§

fn union(&self, other: &STBox, strict: bool) -> Option<STBox>

Source§

fn intersection(&self, other: &STBox) -> Option<STBox>

Source§

fn nearest_approach_distance(&self, other: &STBox) -> f64

Source§

impl Clone for STBox

Source§

fn clone(&self) -> Self

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 Collection for STBox

Source§

type Type = STBox

Source§

fn is_contained_in(&self, container: &Self) -> bool

Returns whether self is contained in container. Read more
Source§

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

Returns whether self overlaps other. That is, both share at least an element. Read more
Source§

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

Returns whether self is strictly before other. That is, self ends before other starts. Read more
Source§

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

Returns whether self is before other allowing overlap. That is, self ends before other ends (or at the same time). Read more
Source§

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

Returns whether self is after other allowing overlap. That is, self starts after other starts (or at the same time). Read more
Source§

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

Returns whether self is strictly after other. That is, self starts after other ends. Read more
Source§

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

Returns whether self is adjacent to other. That is, self starts just after other ends. Read more
Source§

fn contains(&self, content: &Self::Type) -> bool

Determines if the collection contains the specified item. Read more
Source§

impl Debug for STBox

Source§

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

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

impl From<&STBox> for TsTzSpan

Source§

fn from(stbox: &STBox) -> Self

Converts to this type from the input type.
Source§

impl FromStr for STBox

Source§

fn from_str(string: &str) -> Result<Self, Self::Err>

Parses a STBox from a string representation.

§Arguments
  • string - A string slice containing the representation.
§Returns
  • A STBox instance.
§Errors
  • Returns ParseSpanError if the string cannot be parsed.
§Example
use meos::Box;
use std::str::FromStr;

let stbox: STBox = "STBOX ZT(((1.0,2.0,3.0),(4.0,5.0,6.0)),[2001-01-01, 2001-01-02])".parse().expect("Failed to parse span");
let temporal_span: TsTzSpan = stbox.tstzspan();
assert_eq!(temporal_span, TsTzSpan::from_str("[2001-01-01, 2001-01-02]").unwrap());
Source§

type Err = ParseError

The associated error which can be returned from parsing.
Source§

impl PartialEq for STBox

Source§

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

Checks if two STBox instances are equal.

§Arguments
  • other - Another STBox instance.
§Returns
  • true if the spans are equal, false otherwise.
§Example
use std::str::FromStr;
let span1: STBox = STBox::from_str("STBOX ZT(((1.0,2.0,3.0),(4.0,5.0,6.0)),[2001-01-01, 2001-01-02])").unwrap();
let span2: STBox = STBox::from_str("STBOX ZT(((1.0,2.0,3.0),(4.0,5.0,6.0)),[2001-01-01, 2001-01-02])").unwrap();
assert_eq!(span1, span2);
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 Eq for STBox

Auto Trait Implementations§

§

impl Freeze for STBox

§

impl RefUnwindSafe for STBox

§

impl !Send for STBox

§

impl !Sync for STBox

§

impl Unpin for STBox

§

impl UnwindSafe for STBox

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<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 = 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.
Source§

impl<T> BoundingBox for T
where T: Box,