struct RelativeZoned<'a> {
zoned: DumbCow<'a, Zoned>,
}
Expand description
A simple wrapper around a possibly borrowed Zoned
.
Fields§
§zoned: DumbCow<'a, Zoned>
Implementations§
Source§impl<'a> RelativeZoned<'a>
impl<'a> RelativeZoned<'a>
Sourcefn checked_add(&self, span: Span) -> Result<RelativeZoned<'static>, Error>
fn checked_add(&self, span: Span) -> Result<RelativeZoned<'static>, Error>
Returns the result of Zoned::checked_add
.
§Errors
Returns an error in the same cases as Zoned::checked_add
. That is,
when adding the span to this zoned datetime would overflow.
Sourcefn checked_add_duration(
&self,
duration: SignedDuration,
) -> Result<RelativeZoned<'static>, Error>
fn checked_add_duration( &self, duration: SignedDuration, ) -> Result<RelativeZoned<'static>, Error>
Returns the result of Zoned::checked_add
with an absolute duration.
§Errors
Returns an error in the same cases as Zoned::checked_add
. That is,
when adding the span to this zoned datetime would overflow.
Sourcefn until(&self, largest: Unit, other: &RelativeZoned<'a>) -> Result<Span, Error>
fn until(&self, largest: Unit, other: &RelativeZoned<'a>) -> Result<Span, Error>
Returns the result of Zoned::until
.
§Errors
Returns an error in the same cases as Zoned::until
. That is, when
the span for the given largest unit cannot be represented. This can
generally only happen when largest
is Unit::Nanosecond
and the span
cannot be represented as a 64-bit integer of nanoseconds.
Sourcefn borrowed(&self) -> RelativeZoned<'_>
fn borrowed(&self) -> RelativeZoned<'_>
Returns the borrowed version of self; useful when you need to convert
&RelativeZoned
into RelativeZoned
without cloning anything.
Trait Implementations§
Source§impl<'a> Clone for RelativeZoned<'a>
impl<'a> Clone for RelativeZoned<'a>
Source§fn clone(&self) -> RelativeZoned<'a>
fn clone(&self) -> RelativeZoned<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more