pub struct Interval {
pub value: String,
/* private fields */
}Expand description
SQL INTERVAL type - represents a duration
Formats vary: ‘5 YEAR’, ‘1-6 YEAR TO MONTH’, ‘5 12:30:45 DAY TO SECOND’, etc.
Internal representation follows PostgreSQL:
- months: Total months (years * 12 + months)
- days: Total days
- microseconds: Total time in microseconds (hours, minutes, seconds, fractions)
Note: Equality and ordering are based on the internal representation (months, days, microseconds), not the string value. This means “1 YEAR” equals “12 MONTH” even though the strings differ.
Fields§
§value: StringThe original interval string (e.g., “5 YEAR”, “1-6 YEAR TO MONTH”)
Implementations§
Trait Implementations§
Source§impl Ord for Interval
impl Ord for Interval
Source§impl PartialOrd for Interval
impl PartialOrd for Interval
impl Eq 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 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