pub struct Interval {
pub value: Box<Expr>,
pub leading_field: Option<DateTimeField>,
pub leading_precision: Option<u64>,
pub last_field: Option<DateTimeField>,
pub fractional_seconds_precision: Option<u64>,
}Expand description
Represents an INTERVAL expression, roughly in the following format:
INTERVAL '<value>' [ <leading_field> [ (<leading_precision>) ] ] [ TO <last_field> [ (<fractional_seconds_precision>) ] ],
e.g. INTERVAL '123:45.67' MINUTE(3) TO SECOND(2).
The parser does not validate the <value>, nor does it ensure
that the <leading_field> units >= the units in <last_field>,
so the user will have to reject intervals like HOUR TO YEAR.
Fields§
§value: Box<Expr>The interval value expression (commonly a string literal).
leading_field: Option<DateTimeField>Optional leading time unit (e.g., HOUR, MINUTE).
leading_precision: Option<u64>Optional leading precision for the leading field.
last_field: Option<DateTimeField>Optional trailing time unit for a range (e.g., SECOND).
fractional_seconds_precision: Option<u64>The fractional seconds precision, when specified.
See SQL SECOND(n) or SECOND(m, n) forms.
Trait Implementations§
Source§impl Ord for Interval
impl Ord for Interval
Source§impl PartialOrd for Interval
impl PartialOrd for Interval
Source§impl VisitMut for Interval
impl VisitMut for Interval
Source§fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
Mutably visit this node with the provided
VisitorMut. Read moreimpl Eq for Interval
impl StructuralPartialEq for Interval
Auto Trait Implementations§
impl Freeze for Interval
impl RefUnwindSafe for Interval
impl Send for Interval
impl Sync for Interval
impl Unpin for Interval
impl UnsafeUnpin for Interval
impl UnwindSafe for Interval
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