pub struct UtcOffset(/* private fields */);
Implementations§
Source§impl UtcOffset
impl UtcOffset
Sourcepub fn from_seconds(
seconds: i32,
) -> Result<Box<UtcOffset>, TimeZoneInvalidOffsetError>
pub fn from_seconds( seconds: i32, ) -> Result<Box<UtcOffset>, TimeZoneInvalidOffsetError>
Creates an offset from seconds.
Errors if the offset seconds are out of range.
Sourcepub fn from_eighths_of_hour(eighths_of_hour: i8) -> Box<Self>
pub fn from_eighths_of_hour(eighths_of_hour: i8) -> Box<Self>
Creates an offset from eighths of an hour.
Sourcepub fn from_string(
offset: &DiplomatStr,
) -> Result<Box<Self>, TimeZoneInvalidOffsetError>
pub fn from_string( offset: &DiplomatStr, ) -> Result<Box<Self>, TimeZoneInvalidOffsetError>
Creates an offset from a string.
Sourcepub fn eighths_of_hour(&self) -> i8
pub fn eighths_of_hour(&self) -> i8
Gets the offset as eighths of an hour.
Sourcepub fn is_non_negative(&self) -> bool
pub fn is_non_negative(&self) -> bool
Returns whether the offset is positive.
Sourcepub fn hours_part(&self) -> i32
pub fn hours_part(&self) -> i32
Returns the hours part of the offset.
Sourcepub fn minutes_part(&self) -> u32
pub fn minutes_part(&self) -> u32
Returns the minutes part of the offset.
Sourcepub fn seconds_part(&self) -> u32
pub fn seconds_part(&self) -> u32
Returns the seconds part of the offset.
Auto Trait Implementations§
impl Freeze for UtcOffset
impl RefUnwindSafe for UtcOffset
impl Send for UtcOffset
impl Sync for UtcOffset
impl Unpin 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> 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