pub struct IntervalTypmod { /* private fields */ }Expand description
The modifier of an interval type, the fields it keeps and the fractional-second digits it
rounds to, where the default is plain interval.
Implementations§
Source§impl IntervalTypmod
impl IntervalTypmod
Sourcepub const fn new(
fields: Option<IntervalFields>,
precision: Option<u8>,
) -> Option<Self>
pub const fn new( fields: Option<IntervalFields>, precision: Option<u8>, ) -> Option<Self>
intervaltypmodin, clamping a precision above six as PostgreSQL does, or None for a
precision after fields not ending in SECOND.
use sql_values::{IntervalFields, IntervalTypmod};
assert!(IntervalTypmod::new(Some(IntervalFields::DayToSecond), Some(3)).is_some());
assert!(IntervalTypmod::new(None, Some(3)).is_some());
assert!(IntervalTypmod::new(Some(IntervalFields::Minute), Some(3)).is_none());Trait Implementations§
Source§impl Clone for IntervalTypmod
impl Clone for IntervalTypmod
impl Copy for IntervalTypmod
Source§impl Debug for IntervalTypmod
impl Debug for IntervalTypmod
Source§impl Default for IntervalTypmod
impl Default for IntervalTypmod
impl Eq for IntervalTypmod
Source§impl Hash for IntervalTypmod
impl Hash for IntervalTypmod
Source§impl PartialEq for IntervalTypmod
impl PartialEq for IntervalTypmod
impl StructuralPartialEq for IntervalTypmod
Auto Trait Implementations§
impl Freeze for IntervalTypmod
impl RefUnwindSafe for IntervalTypmod
impl Send for IntervalTypmod
impl Sync for IntervalTypmod
impl Unpin for IntervalTypmod
impl UnsafeUnpin for IntervalTypmod
impl UnwindSafe for IntervalTypmod
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