Skip to main content

DurationSigned

Struct DurationSigned 

Source
pub(crate) struct DurationSigned {
    pub(crate) sign: Sign,
    pub(crate) duration: Duration,
}

Fields§

§sign: Sign§duration: Duration

Implementations§

Source§

impl DurationSigned

Source

pub(crate) fn new(sign: Sign, secs: u64, nanosecs: u32) -> Self

Source

pub(crate) fn checked_mul(self, rhs: u32) -> Option<Self>

Source

pub(crate) fn checked_div(self, rhs: u32) -> Option<Self>

Source

pub(crate) fn to_system_time<'de, D>(self) -> Result<SystemTime, D::Error>
where D: Deserializer<'de>,

Source

pub(crate) fn to_std_duration<'de, D>(self) -> Result<Duration, D::Error>
where D: Deserializer<'de>,

Trait Implementations§

Source§

impl Clone for DurationSigned

Source§

fn clone(&self) -> DurationSigned

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'de, FORMAT, STRICTNESS> DeserializeAs<'de, DurationSigned> for DurationMicroSeconds<FORMAT, STRICTNESS>
where FORMAT: Format, STRICTNESS: Strictness, DurationSeconds<FORMAT, STRICTNESS>: DeserializeAs<'de, DurationSigned>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl<'de, FORMAT, STRICTNESS> DeserializeAs<'de, DurationSigned> for DurationMicroSecondsWithFrac<FORMAT, STRICTNESS>
where FORMAT: Format, STRICTNESS: Strictness, DurationSecondsWithFrac<FORMAT, STRICTNESS>: DeserializeAs<'de, DurationSigned>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl<'de, FORMAT, STRICTNESS> DeserializeAs<'de, DurationSigned> for DurationMilliSeconds<FORMAT, STRICTNESS>
where FORMAT: Format, STRICTNESS: Strictness, DurationSeconds<FORMAT, STRICTNESS>: DeserializeAs<'de, DurationSigned>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl<'de, FORMAT, STRICTNESS> DeserializeAs<'de, DurationSigned> for DurationMilliSecondsWithFrac<FORMAT, STRICTNESS>
where FORMAT: Format, STRICTNESS: Strictness, DurationSecondsWithFrac<FORMAT, STRICTNESS>: DeserializeAs<'de, DurationSigned>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl<'de, FORMAT, STRICTNESS> DeserializeAs<'de, DurationSigned> for DurationNanoSeconds<FORMAT, STRICTNESS>
where FORMAT: Format, STRICTNESS: Strictness, DurationSeconds<FORMAT, STRICTNESS>: DeserializeAs<'de, DurationSigned>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl<'de, FORMAT, STRICTNESS> DeserializeAs<'de, DurationSigned> for DurationNanoSecondsWithFrac<FORMAT, STRICTNESS>
where FORMAT: Format, STRICTNESS: Strictness, DurationSecondsWithFrac<FORMAT, STRICTNESS>: DeserializeAs<'de, DurationSigned>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl<'de> DeserializeAs<'de, DurationSigned> for DurationSeconds<u64, Strict>

Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl<'de, FORMAT> DeserializeAs<'de, DurationSigned> for DurationSeconds<FORMAT, Flexible>
where FORMAT: Format,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl<'de> DeserializeAs<'de, DurationSigned> for DurationSeconds<String, Strict>

Available on crate feature alloc only.
Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl<'de> DeserializeAs<'de, DurationSigned> for DurationSeconds<f64, Strict>

Available on crate feature std only.
Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl<'de> DeserializeAs<'de, DurationSigned> for DurationSeconds<i64, Strict>

Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl<'de> DeserializeAs<'de, DurationSigned> for DurationSecondsWithFrac<f64, Strict>

Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl<'de, FORMAT> DeserializeAs<'de, DurationSigned> for DurationSecondsWithFrac<FORMAT, Flexible>
where FORMAT: Format,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl<'de> DeserializeAs<'de, DurationSigned> for DurationSecondsWithFrac<String, Strict>

Available on crate feature alloc only.
Source§

fn deserialize_as<D>(deserializer: D) -> Result<DurationSigned, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
Source§

impl From<&Duration> for DurationSigned

Source§

fn from(duration: &Duration) -> Self

Converts to this type from the input type.
Source§

impl From<&SystemTime> for DurationSigned

Available on crate feature std only.
Source§

fn from(time: &SystemTime) -> Self

Converts to this type from the input type.
Source§

impl<FORMAT, STRICTNESS> SerializeAs<DurationSigned> for DurationMicroSeconds<FORMAT, STRICTNESS>
where FORMAT: Format, STRICTNESS: Strictness, DurationSeconds<FORMAT, STRICTNESS>: SerializeAs<DurationSigned>,

Source§

fn serialize_as<S>( source: &DurationSigned, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
Source§

impl<FORMAT, STRICTNESS> SerializeAs<DurationSigned> for DurationMicroSecondsWithFrac<FORMAT, STRICTNESS>
where FORMAT: Format, STRICTNESS: Strictness, DurationSecondsWithFrac<FORMAT, STRICTNESS>: SerializeAs<DurationSigned>,

Source§

fn serialize_as<S>( source: &DurationSigned, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
Source§

impl<FORMAT, STRICTNESS> SerializeAs<DurationSigned> for DurationMilliSeconds<FORMAT, STRICTNESS>
where FORMAT: Format, STRICTNESS: Strictness, DurationSeconds<FORMAT, STRICTNESS>: SerializeAs<DurationSigned>,

Source§

fn serialize_as<S>( source: &DurationSigned, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
Source§

impl<FORMAT, STRICTNESS> SerializeAs<DurationSigned> for DurationMilliSecondsWithFrac<FORMAT, STRICTNESS>
where FORMAT: Format, STRICTNESS: Strictness, DurationSecondsWithFrac<FORMAT, STRICTNESS>: SerializeAs<DurationSigned>,

Source§

fn serialize_as<S>( source: &DurationSigned, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
Source§

impl<FORMAT, STRICTNESS> SerializeAs<DurationSigned> for DurationNanoSeconds<FORMAT, STRICTNESS>
where FORMAT: Format, STRICTNESS: Strictness, DurationSeconds<FORMAT, STRICTNESS>: SerializeAs<DurationSigned>,

Source§

fn serialize_as<S>( source: &DurationSigned, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
Source§

impl<FORMAT, STRICTNESS> SerializeAs<DurationSigned> for DurationNanoSecondsWithFrac<FORMAT, STRICTNESS>
where FORMAT: Format, STRICTNESS: Strictness, DurationSecondsWithFrac<FORMAT, STRICTNESS>: SerializeAs<DurationSigned>,

Source§

fn serialize_as<S>( source: &DurationSigned, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
Source§

impl<STRICTNESS> SerializeAs<DurationSigned> for DurationSeconds<String, STRICTNESS>
where STRICTNESS: Strictness,

Available on crate feature alloc only.
Source§

fn serialize_as<S>( source: &DurationSigned, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
Source§

impl<STRICTNESS> SerializeAs<DurationSigned> for DurationSeconds<f64, STRICTNESS>
where STRICTNESS: Strictness,

Source§

fn serialize_as<S>( source: &DurationSigned, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
Source§

impl<STRICTNESS> SerializeAs<DurationSigned> for DurationSeconds<i64, STRICTNESS>
where STRICTNESS: Strictness,

Source§

fn serialize_as<S>( source: &DurationSigned, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
Source§

impl<STRICTNESS> SerializeAs<DurationSigned> for DurationSeconds<u64, STRICTNESS>
where STRICTNESS: Strictness,

Source§

fn serialize_as<S>( source: &DurationSigned, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
Source§

impl<STRICTNESS> SerializeAs<DurationSigned> for DurationSecondsWithFrac<String, STRICTNESS>
where STRICTNESS: Strictness,

Available on crate feature alloc only.
Source§

fn serialize_as<S>( source: &DurationSigned, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
Source§

impl<STRICTNESS> SerializeAs<DurationSigned> for DurationSecondsWithFrac<f64, STRICTNESS>
where STRICTNESS: Strictness,

Source§

fn serialize_as<S>( source: &DurationSigned, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
Source§

impl Copy for DurationSigned

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.