pub struct DateTimeValue { /* private fields */ }Expand description
A validated calendar date and time with an optional UTC offset.
Implementations§
Source§impl DateTimeValue
impl DateTimeValue
Sourcepub fn new(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanosecond: u32,
offset_seconds: Option<i32>,
) -> Result<Self, TemporalValueError>
pub fn new( year: i32, month: u8, day: u8, hour: u8, minute: u8, second: u8, nanosecond: u32, offset_seconds: Option<i32>, ) -> Result<Self, TemporalValueError>
Creates a validated datetime value.
Sourcepub fn parse_iso8601(input: &str) -> Result<Self, TemporalValueError>
pub fn parse_iso8601(input: &str) -> Result<Self, TemporalValueError>
Parses a canonical ISO-8601 datetime string.
Sourcepub fn nanosecond(&self) -> u32
pub fn nanosecond(&self) -> u32
Returns the fractional nanoseconds component.
Sourcepub fn offset_seconds(&self) -> Option<i32>
pub fn offset_seconds(&self) -> Option<i32>
Returns the offset from UTC in seconds, or None for naive datetimes.
Trait Implementations§
Source§impl Clone for DateTimeValue
impl Clone for DateTimeValue
Source§fn clone(&self) -> DateTimeValue
fn clone(&self) -> DateTimeValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DateTimeValue
impl Debug for DateTimeValue
Source§impl<'de> Deserialize<'de> for DateTimeValue
impl<'de> Deserialize<'de> for DateTimeValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DateTimeValue
impl Display for DateTimeValue
Source§impl From<DateTimeValue> for TemporalValue
impl From<DateTimeValue> for TemporalValue
Source§fn from(value: DateTimeValue) -> Self
fn from(value: DateTimeValue) -> Self
Converts to this type from the input type.
Source§impl FromStr for DateTimeValue
impl FromStr for DateTimeValue
Source§impl PartialEq for DateTimeValue
impl PartialEq for DateTimeValue
Source§impl Serialize for DateTimeValue
impl Serialize for DateTimeValue
impl Eq for DateTimeValue
impl StructuralPartialEq for DateTimeValue
Auto Trait Implementations§
impl Freeze for DateTimeValue
impl RefUnwindSafe for DateTimeValue
impl Send for DateTimeValue
impl Sync for DateTimeValue
impl Unpin for DateTimeValue
impl UnwindSafe for DateTimeValue
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.