pub struct UtcOffset { /* private fields */ }Expand description
A UTC offset value, e.g. +0800 or -0530.
This is used by the utc-offset value type and by time zone information inside time values.
Implementations§
Source§impl UtcOffset
impl UtcOffset
Sourcepub const fn new(
negative: bool,
hour: u8,
minute: u8,
) -> Result<Self, InvalidValueError>
pub const fn new( negative: bool, hour: u8, minute: u8, ) -> Result<Self, InvalidValueError>
Creates a UTC offset from a sign, an hour within 0..=23 and a minute within 0..=59.
Sourcepub fn to_fixed_offset(&self) -> FixedOffset
pub fn to_fixed_offset(&self) -> FixedOffset
Converts this offset into a chrono FixedOffset.
Trait Implementations§
impl Copy for UtcOffset
impl Eq for UtcOffset
Source§impl From<FixedOffset> for UtcOffset
impl From<FixedOffset> for UtcOffset
Source§fn from(offset: FixedOffset) -> Self
fn from(offset: FixedOffset) -> Self
Converts a chrono FixedOffset into a UtcOffset, truncating the sub-minute part.
impl StructuralPartialEq for UtcOffset
Auto Trait Implementations§
impl Freeze for UtcOffset
impl RefUnwindSafe for UtcOffset
impl Send for UtcOffset
impl Sync for UtcOffset
impl Unpin for UtcOffset
impl UnsafeUnpin for UtcOffset
impl UnwindSafe for UtcOffset
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more