pub struct STBox { /* private fields */ }Implementations§
Trait Implementations§
Source§impl Box for STBox
impl Box for STBox
Source§fn from_time<Tz: TimeZone>(time: DateTime<Tz>) -> Self
fn from_time<Tz: TimeZone>(time: DateTime<Tz>) -> Self
Creates an STBox from a DateTime value.
§Arguments
time- ADateTime<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);fn from_wkb(wkb: &[u8]) -> Self
fn from_hexwkb(hexwkb: &[u8]) -> Self
fn from_temporal_span(span: TsTzSpan) -> Self
fn tstzspan(&self) -> TsTzSpan
fn as_wkb(&self, variant: WKBVariant) -> &[u8] ⓘ
fn as_hexwkb(&self, variant: WKBVariant) -> &[u8] ⓘ
fn has_x(&self) -> bool
fn has_t(&self) -> bool
fn xmin(&self) -> Option<f64>
fn xmax(&self) -> Option<f64>
fn tmin(&self) -> Option<DateTime<Utc>>
fn tmax(&self) -> Option<DateTime<Utc>>
fn is_tmin_inclusive(&self) -> Option<bool>
fn is_tmax_inclusive(&self) -> Option<bool>
fn expand_time(&self, duration: TimeDelta) -> STBox
fn shift_scale_time( &self, delta: Option<TimeDelta>, width: Option<TimeDelta>, ) -> STBox
fn round(&self, max_decimals: i32) -> STBox
fn union(&self, other: &STBox, strict: bool) -> Option<STBox>
fn intersection(&self, other: &STBox) -> Option<STBox>
fn nearest_approach_distance(&self, other: &STBox) -> f64
Source§impl Collection for STBox
impl Collection for STBox
type Type = STBox
Source§fn is_contained_in(&self, container: &Self) -> bool
fn is_contained_in(&self, container: &Self) -> bool
Source§fn is_over_or_left(&self, other: &Self) -> bool
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 moreSource§fn is_over_or_right(&self, other: &Self) -> bool
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 moreSource§fn is_adjacent(&self, other: &Self) -> bool
fn is_adjacent(&self, other: &Self) -> bool
Source§impl FromStr for STBox
impl FromStr for STBox
Source§fn from_str(string: &str) -> Result<Self, Self::Err>
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
STBoxinstance.
§Errors
- Returns
ParseSpanErrorif 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
type Err = ParseError
The associated error which can be returned from parsing.
Source§impl PartialEq for STBox
impl PartialEq for STBox
Source§fn eq(&self, other: &Self) -> bool
fn eq(&self, other: &Self) -> bool
Checks if two STBox instances are equal.
§Arguments
other- AnotherSTBoxinstance.
§Returns
trueif the spans are equal,falseotherwise.
§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);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> 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
Mutably borrows from an owned value. Read more