pub struct Interval { /* private fields */ }Expand description
An interval value.
Hyper stores intervals as a 128-bit packed value with:
- microseconds (i64): time component
- days (i32): day component
- months (i32): month component
Implementations§
Source§impl Interval
impl Interval
Sourcepub const fn new(months: i32, days: i32, microseconds: i64) -> Interval
pub const fn new(months: i32, days: i32, microseconds: i64) -> Interval
Creates an Interval from components.
Sourcepub const fn from_years(years: i32) -> Interval
pub const fn from_years(years: i32) -> Interval
Creates an Interval from years.
Sourcepub const fn from_months(months: i32) -> Interval
pub const fn from_months(months: i32) -> Interval
Creates an Interval from months.
Sourcepub const fn from_hours(hours: i64) -> Interval
pub const fn from_hours(hours: i64) -> Interval
Creates an Interval from hours.
Sourcepub const fn from_minutes(minutes: i64) -> Interval
pub const fn from_minutes(minutes: i64) -> Interval
Creates an Interval from minutes.
Sourcepub const fn from_seconds(seconds: i64) -> Interval
pub const fn from_seconds(seconds: i64) -> Interval
Creates an Interval from seconds.
Sourcepub const fn from_microseconds(microseconds: i64) -> Interval
pub const fn from_microseconds(microseconds: i64) -> Interval
Creates an Interval from microseconds.
Sourcepub const fn microseconds(&self) -> i64
pub const fn microseconds(&self) -> i64
Returns the microseconds component.
Trait Implementations§
Source§impl FromBinaryValue for Interval
impl FromBinaryValue for Interval
Source§impl FromHyperBinary for Interval
impl FromHyperBinary for Interval
Source§impl ToHyperBinary for Interval
impl ToHyperBinary for Interval
Source§fn to_hyper_binary(
&self,
buf: &mut BytesMut,
) -> Result<(), Box<dyn Error + Sync + Send>>
fn to_hyper_binary( &self, buf: &mut BytesMut, ) -> Result<(), Box<dyn Error + Sync + Send>>
Serializes the value to HyperBinary format for a nullable column. Read more
Source§fn to_hyper_binary_not_null(
&self,
buf: &mut BytesMut,
) -> Result<(), Box<dyn Error + Sync + Send>>
fn to_hyper_binary_not_null( &self, buf: &mut BytesMut, ) -> Result<(), Box<dyn Error + Sync + Send>>
Serializes the value to HyperBinary format for a NOT NULL column. Read more
Source§fn hyper_binary_size(&self) -> usize
fn hyper_binary_size(&self) -> usize
Returns the size in bytes this value will occupy when serialized (nullable).
Source§fn hyper_binary_size_not_null(&self) -> usize
fn hyper_binary_size_not_null(&self) -> usize
Returns the size in bytes this value will occupy when serialized (not nullable).
impl Copy for Interval
impl 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request