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 UNMODIFIED: Self
pub const UNMODIFIED: Self
Preserves every field without rounding fractional seconds.
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 independently of the fields.
use sql_values::postgres::{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_some());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
Source§impl Display for IntervalTypmod
impl Display 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 Forget for IntervalTypmod
impl Freeze for IntervalTypmod
impl Move 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