pub struct TimeZoneOffset { /* private fields */ }Expand description
A fixed UTC offset in signed minutes.
Implementations§
Source§impl TimeZoneOffset
impl TimeZoneOffset
Sourcepub fn try_new(input: &str) -> Result<Self, TimeZoneParseError>
pub fn try_new(input: &str) -> Result<Self, TimeZoneParseError>
Parses a fixed time zone offset with diagnostic errors.
§Errors
Returns TimeZoneParseError when the input is empty, contains whitespace,
is malformed, or falls outside the civil -14:00..=+14:00 range.
Sourcepub const fn from_minutes(minutes: i16) -> Option<Self>
pub const fn from_minutes(minutes: i16) -> Option<Self>
Returns an offset from signed minutes when it is in the civil range.
Sourcepub const fn total_minutes(self) -> i16
pub const fn total_minutes(self) -> i16
Returns the signed offset in minutes.
Trait Implementations§
Source§impl Clone for TimeZoneOffset
impl Clone for TimeZoneOffset
Source§fn clone(&self) -> TimeZoneOffset
fn clone(&self) -> TimeZoneOffset
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TimeZoneOffset
impl Debug for TimeZoneOffset
Source§impl Display for TimeZoneOffset
impl Display for TimeZoneOffset
Source§impl Hash for TimeZoneOffset
impl Hash for TimeZoneOffset
Source§impl Ord for TimeZoneOffset
impl Ord for TimeZoneOffset
Source§fn cmp(&self, other: &TimeZoneOffset) -> Ordering
fn cmp(&self, other: &TimeZoneOffset) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TimeZoneOffset
impl PartialEq for TimeZoneOffset
Source§fn eq(&self, other: &TimeZoneOffset) -> bool
fn eq(&self, other: &TimeZoneOffset) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for TimeZoneOffset
impl PartialOrd for TimeZoneOffset
impl Copy for TimeZoneOffset
impl Eq for TimeZoneOffset
impl StructuralPartialEq for TimeZoneOffset
Auto Trait Implementations§
impl Freeze for TimeZoneOffset
impl RefUnwindSafe for TimeZoneOffset
impl Send for TimeZoneOffset
impl Sync for TimeZoneOffset
impl Unpin for TimeZoneOffset
impl UnsafeUnpin for TimeZoneOffset
impl UnwindSafe for TimeZoneOffset
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