matrix_sdk::ruma::time

Struct SystemTime

1.8.0 · Source
pub struct SystemTime(/* private fields */);
Expand description

A measurement of the system clock, useful for talking to external entities like the file system or other processes.

Distinct from the Instant type, this time measurement is not monotonic. This means that you can save a file to the file system, then save another file to the file system, and the second file has a SystemTime measurement earlier than the first. In other words, an operation that happens after another operation in real time may have an earlier SystemTime!

Consequently, comparing two SystemTime instances to learn about the duration between them returns a Result instead of an infallible Duration to indicate that this sort of time drift may happen and needs to be handled.

Although a SystemTime cannot be directly inspected, the UNIX_EPOCH constant is provided in this module as an anchor in time to learn information about a SystemTime. By calculating the duration from this fixed point in time, a SystemTime can be converted to a human-readable time, or perhaps some other string representation.

The size of a SystemTime struct may vary depending on the target operating system.

A SystemTime does not count leap seconds. SystemTime::now()’s behavior around a leap second is the same as the operating system’s wall clock. The precise behavior near a leap second (e.g. whether the clock appears to run slow or fast, or stop, or jump) depends on platform and configuration, so should not be relied on.

Example:

use std::time::{Duration, SystemTime};
use std::thread::sleep;

fn main() {
   let now = SystemTime::now();

   // we sleep for 2 seconds
   sleep(Duration::new(2, 0));
   match now.elapsed() {
       Ok(elapsed) => {
           // it prints '2'
           println!("{}", elapsed.as_secs());
       }
       Err(e) => {
           // an error occurred!
           println!("Error: {e:?}");
       }
   }
}

§Platform-specific behavior

The precision of SystemTime can depend on the underlying OS-specific time format. For example, on Windows the time is represented in 100 nanosecond intervals whereas Linux can represent nanosecond intervals.

The following system calls are currently being used by now() to find out the current time:

Disclaimer: These system calls might change over time.

Note: mathematical operations like add may panic if the underlying structure cannot represent the new point in time.

Implementations§

Source§

impl SystemTime

1.28.0 · Source

pub const UNIX_EPOCH: SystemTime = UNIX_EPOCH

An anchor in time which can be used to create new SystemTime instances or learn about where in time a SystemTime lies.

This constant is defined to be “1970-01-01 00:00:00 UTC” on all systems with respect to the system clock. Using duration_since on an existing SystemTime instance can tell how far away from this point in time a measurement lies, and using UNIX_EPOCH + duration can be used to create a SystemTime instance to represent another fixed point in time.

duration_since(UNIX_EPOCH).unwrap().as_secs() returns the number of non-leap seconds since the start of 1970 UTC. This is a POSIX time_t (as a u64), and is the same time representation as used in many Internet protocols.

§Examples
use std::time::SystemTime;

match SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) {
    Ok(n) => println!("1970-01-01 00:00:00 UTC was {} seconds ago!", n.as_secs()),
    Err(_) => panic!("SystemTime before UNIX EPOCH!"),
}
1.8.0 · Source

pub fn now() -> SystemTime

Returns the system time corresponding to “now”.

§Examples
use std::time::SystemTime;

let sys_time = SystemTime::now();
1.8.0 · Source

pub fn duration_since( &self, earlier: SystemTime, ) -> Result<Duration, SystemTimeError>

Returns the amount of time elapsed from an earlier point in time.

This function may fail because measurements taken earlier are not guaranteed to always be before later measurements (due to anomalies such as the system clock being adjusted either forwards or backwards). Instant can be used to measure elapsed time without this risk of failure.

If successful, Ok(Duration) is returned where the duration represents the amount of time elapsed from the specified measurement to this one.

Returns an Err if earlier is later than self, and the error contains how far from self the time is.

§Examples
use std::time::SystemTime;

let sys_time = SystemTime::now();
let new_sys_time = SystemTime::now();
let difference = new_sys_time.duration_since(sys_time)
    .expect("Clock may have gone backwards");
println!("{difference:?}");
1.8.0 · Source

pub fn elapsed(&self) -> Result<Duration, SystemTimeError>

Returns the difference from this system time to the current clock time.

This function may fail as the underlying system clock is susceptible to drift and updates (e.g., the system clock could go backwards), so this function might not always succeed. If successful, Ok(Duration) is returned where the duration represents the amount of time elapsed from this time measurement to the current time.

To measure elapsed time reliably, use Instant instead.

Returns an Err if self is later than the current system time, and the error contains how far from the current system time self is.

§Examples
use std::thread::sleep;
use std::time::{Duration, SystemTime};

let sys_time = SystemTime::now();
let one_sec = Duration::from_secs(1);
sleep(one_sec);
assert!(sys_time.elapsed().unwrap() >= one_sec);
1.34.0 · Source

pub fn checked_add(&self, duration: Duration) -> Option<SystemTime>

Returns Some(t) where t is the time self + duration if t can be represented as SystemTime (which means it’s inside the bounds of the underlying data structure), None otherwise.

1.34.0 · Source

pub fn checked_sub(&self, duration: Duration) -> Option<SystemTime>

Returns Some(t) where t is the time self - duration if t can be represented as SystemTime (which means it’s inside the bounds of the underlying data structure), None otherwise.

Trait Implementations§

1.8.0 · Source§

impl Add<Duration> for SystemTime

Source§

fn add(self, dur: Duration) -> SystemTime

§Panics

This function may panic if the resulting point in time cannot be represented by the underlying data structure. See SystemTime::checked_add for a version without panic.

Source§

type Output = SystemTime

The resulting type after applying the + operator.
Source§

impl Add<Duration> for SystemTime

Available on crate feature std only.
Source§

type Output = SystemTime

The resulting type after applying the + operator.
Source§

fn add(self, duration: Duration) -> <SystemTime as Add<Duration>>::Output

Performs the + operation. Read more
1.9.0 · Source§

impl AddAssign<Duration> for SystemTime

Source§

fn add_assign(&mut self, other: Duration)

Performs the += operation. Read more
Source§

impl AddAssign<Duration> for SystemTime

Available on crate feature std only.
Source§

fn add_assign(&mut self, rhs: Duration)

Performs the += operation. Read more
1.8.0 · Source§

impl Clone for SystemTime

Source§

fn clone(&self) -> SystemTime

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<UT> ConvertError<UT> for SystemTime

1.8.0 · Source§

impl Debug for SystemTime

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a> DecodeValue<'a> for SystemTime

Available on crate feature std only.
Source§

fn decode_value<R>(reader: &mut R, header: Header) -> Result<SystemTime, Error>
where R: Reader<'a>,

Attempt to decode this message using the provided Reader.
Source§

impl<'de> Deserialize<'de> for SystemTime

Available on crate feature std only.
Source§

fn deserialize<D>( deserializer: D, ) -> Result<SystemTime, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl EncodeValue for SystemTime

Available on crate feature std only.
Source§

fn value_len(&self) -> Result<Length, Error>

Compute the length of this value (sans [Tag]+Length header) when encoded as ASN.1 DER.
Source§

fn encode_value(&self, writer: &mut impl Writer) -> Result<(), Error>

Encode value (sans [Tag]+Length header) as ASN.1 DER using the provided Writer.
Source§

fn header(&self) -> Result<Header, Error>
where Self: Tagged,

Get the Header used to encode this value.
Source§

impl<UT> FfiConverter<UT> for SystemTime

Support for passing timestamp values via the FFI.

Timestamps values are currently always passed by serializing to a buffer.

Timestamps are represented on the buffer by an i64 that indicates the direction and the magnitude in seconds of the offset from epoch, and a u32 that indicates the nanosecond portion of the offset magnitude. The nanosecond portion is expected to be between 0 and 999,999,999.

To build an epoch offset the absolute value of the seconds portion of the offset should be combined with the nanosecond portion. This is because the sign of the seconds portion represents the direction of the offset overall. The sign of the seconds portion can then be used to determine if the total offset should be added to or subtracted from the unix epoch.

Source§

const TYPE_ID_META: MetadataBuffer = _

Type ID metadata, serialized into a MetadataBuffer.
Source§

type FfiType = RustBuffer

The low-level type used for passing values of this type over the FFI. Read more
Source§

fn lower(v: SystemTime) -> RustBuffer

Lower a rust value of the target type, into an FFI value of type Self::FfiType. Read more
Source§

fn try_lift(buf: RustBuffer) -> Result<SystemTime, Error>

Lift a rust value of the target type, from an FFI value of type Self::FfiType. Read more
Source§

fn write(obj: SystemTime, buf: &mut Vec<u8>)

Write a rust value into a buffer, to send over the FFI in serialized form. Read more
Source§

fn try_read(buf: &mut &[u8]) -> Result<SystemTime, Error>

Read a rust value from a buffer, received over the FFI in serialized form. Read more
Source§

impl FixedTag for SystemTime

Available on crate feature std only.
Source§

const TAG: Tag = Tag::GeneralizedTime

ASN.1 tag
Source§

impl From<&DateTime> for SystemTime

Available on crate feature std only.
Source§

fn from(time: &DateTime) -> SystemTime

Converts to this type from the input type.
Source§

impl From<&GeneralizedTime> for SystemTime

Available on crate feature std only.
Source§

fn from(time: &GeneralizedTime) -> SystemTime

Converts to this type from the input type.
Source§

impl From<Date> for SystemTime

Source§

fn from(date: Date) -> SystemTime

Converts to this type from the input type.
Source§

impl<Tz> From<DateTime<Tz>> for SystemTime
where Tz: TimeZone,

Available on crate feature std only.
Source§

fn from(dt: DateTime<Tz>) -> SystemTime

Converts to this type from the input type.
Source§

impl From<DateTime> for SystemTime

Available on crate feature std only.
Source§

fn from(time: DateTime) -> SystemTime

Converts to this type from the input type.
Source§

impl From<Expires> for SystemTime

Source§

fn from(date: Expires) -> SystemTime

Converts to this type from the input type.
Source§

impl From<GeneralizedTime> for SystemTime

Available on crate feature std only.
Source§

fn from(time: GeneralizedTime) -> SystemTime

Converts to this type from the input type.
Source§

impl From<HttpDate> for SystemTime

Source§

fn from(v: HttpDate) -> SystemTime

Converts to this type from the input type.
Source§

impl From<HttpDate> for SystemTime

Source§

fn from(date: HttpDate) -> SystemTime

Converts to this type from the input type.
Source§

impl From<IfModifiedSince> for SystemTime

Source§

fn from(date: IfModifiedSince) -> SystemTime

Converts to this type from the input type.
Source§

impl From<IfUnmodifiedSince> for SystemTime

Source§

fn from(date: IfUnmodifiedSince) -> SystemTime

Converts to this type from the input type.
Source§

impl From<LastModified> for SystemTime

Source§

fn from(date: LastModified) -> SystemTime

Converts to this type from the input type.
Source§

impl From<OffsetDateTime> for SystemTime

Available on crate feature std only.
Source§

fn from(datetime: OffsetDateTime) -> SystemTime

Converts to this type from the input type.
Source§

impl From<SystemTime> for Date

Source§

fn from(time: SystemTime) -> Date

Converts to this type from the input type.
Source§

impl From<SystemTime> for DateTime<Local>

Available on crate feature clock only.
Source§

fn from(t: SystemTime) -> DateTime<Local>

Converts to this type from the input type.
Source§

impl From<SystemTime> for DateTime<Utc>

Available on crate feature std only.
Source§

fn from(t: SystemTime) -> DateTime<Utc>

Converts to this type from the input type.
Source§

impl From<SystemTime> for Expires

Source§

fn from(time: SystemTime) -> Expires

Converts to this type from the input type.
Source§

impl From<SystemTime> for HttpDate

Source§

fn from(v: SystemTime) -> HttpDate

Converts to this type from the input type.
Source§

impl From<SystemTime> for IfModifiedSince

Source§

fn from(time: SystemTime) -> IfModifiedSince

Converts to this type from the input type.
Source§

impl From<SystemTime> for IfUnmodifiedSince

Source§

fn from(time: SystemTime) -> IfUnmodifiedSince

Converts to this type from the input type.
Source§

impl From<SystemTime> for LastModified

Source§

fn from(time: SystemTime) -> LastModified

Converts to this type from the input type.
Source§

impl From<SystemTime> for OffsetDateTime

Available on crate feature std only.
Source§

fn from(system_time: SystemTime) -> OffsetDateTime

Converts to this type from the input type.
Source§

impl From<UtcTime> for SystemTime

Available on crate feature std only.
Source§

fn from(utc_time: UtcTime) -> SystemTime

Converts to this type from the input type.
1.8.0 · Source§

impl Hash for SystemTime

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl JsonSchema for SystemTime

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

impl<UT> Lift<UT> for SystemTime

Source§

impl<UT> LiftRef<UT> for SystemTime

Source§

impl<UT> LiftReturn<UT> for SystemTime

Source§

type ReturnType = <SystemTime as Lift<UT>>::FfiType

FFI return type for trait interfaces
Source§

fn try_lift_successful_return( v: <SystemTime as LiftReturn<UT>>::ReturnType, ) -> Result<SystemTime, Error>

Lift a successfully returned value from a trait interface
Source§

fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self

Lift a foreign returned value from a trait interface Read more
Source§

fn lift_error(_buf: RustBuffer) -> Self

Lift a Rust value for a callback interface method error result Read more
Source§

fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self

Lift a Rust value for an unexpected callback interface error Read more
Source§

impl<UT> Lower<UT> for SystemTime

Source§

type FfiType = <SystemTime as FfiConverter<UT>>::FfiType

Source§

fn lower(obj: SystemTime) -> <SystemTime as Lower<UT>>::FfiType

Source§

fn write(obj: SystemTime, buf: &mut Vec<u8>)

Source§

fn lower_into_rust_buffer(obj: Self) -> RustBuffer

Convenience method
Source§

impl<UT> LowerError<UT> for SystemTime

Source§

fn lower_error(obj: SystemTime) -> RustBuffer

Lower this value for scaffolding function return Read more
Source§

impl<UT> LowerReturn<UT> for SystemTime

Source§

type ReturnType = <SystemTime as Lower<UT>>::FfiType

The type that should be returned by scaffolding functions for this type. Read more
Source§

fn lower_return( obj: SystemTime, ) -> Result<<SystemTime as LowerReturn<UT>>::ReturnType, RustBuffer>

Lower this value for scaffolding function return Read more
Source§

fn handle_failed_lift(arg_name: &str, e: Error) -> Self

If possible, get a serialized error for failed argument lifts Read more
1.8.0 · Source§

impl Ord for SystemTime

Source§

fn cmp(&self, other: &SystemTime) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq<OffsetDateTime> for SystemTime

Available on crate feature std only.
Source§

fn eq(&self, rhs: &OffsetDateTime) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
1.8.0 · Source§

impl PartialEq for SystemTime

Source§

fn eq(&self, other: &SystemTime) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd<OffsetDateTime> for SystemTime

Available on crate feature std only.
Source§

fn partial_cmp(&self, other: &OffsetDateTime) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
1.8.0 · Source§

impl PartialOrd for SystemTime

Source§

fn partial_cmp(&self, other: &SystemTime) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for SystemTime

Available on crate feature std only.
Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
1.8.0 · Source§

impl Sub<Duration> for SystemTime

Source§

type Output = SystemTime

The resulting type after applying the - operator.
Source§

fn sub(self, dur: Duration) -> SystemTime

Performs the - operation. Read more
Source§

impl Sub<Duration> for SystemTime

Available on crate feature std only.
Source§

type Output = SystemTime

The resulting type after applying the - operator.
Source§

fn sub(self, duration: Duration) -> <SystemTime as Sub<Duration>>::Output

Performs the - operation. Read more
Source§

impl Sub<OffsetDateTime> for SystemTime

Available on crate feature std only.
Source§

fn sub(self, rhs: OffsetDateTime) -> <SystemTime as Sub<OffsetDateTime>>::Output

§Panics

This may panic if an overflow occurs.

Source§

type Output = Duration

The resulting type after applying the - operator.
1.9.0 · Source§

impl SubAssign<Duration> for SystemTime

Source§

fn sub_assign(&mut self, other: Duration)

Performs the -= operation. Read more
Source§

impl SubAssign<Duration> for SystemTime

Available on crate feature std only.
Source§

fn sub_assign(&mut self, rhs: Duration)

Performs the -= operation. Read more
Source§

impl TryFrom<&SystemTime> for DateTime

Available on crate feature std only.
Source§

type Error = Error

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

fn try_from(time: &SystemTime) -> Result<DateTime, Error>

Performs the conversion.
Source§

impl TryFrom<&SystemTime> for GeneralizedTime

Available on crate feature std only.
Source§

type Error = Error

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

fn try_from(time: &SystemTime) -> Result<GeneralizedTime, Error>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRef<'a>> for SystemTime

Available on crate feature std only.
Source§

type Error = Error

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

fn try_from(any: AnyRef<'a>) -> Result<SystemTime, Error>

Performs the conversion.
Source§

impl TryFrom<SystemTime> for DateTime

Available on crate feature std only.
Source§

type Error = Error

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

fn try_from(time: SystemTime) -> Result<DateTime, Error>

Performs the conversion.
Source§

impl TryFrom<SystemTime> for GeneralizedTime

Available on crate feature std only.
Source§

type Error = Error

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

fn try_from(time: SystemTime) -> Result<GeneralizedTime, Error>

Performs the conversion.
Source§

impl<UT> TypeId<UT> for SystemTime

1.8.0 · Source§

impl Copy for SystemTime

1.8.0 · Source§

impl Eq for SystemTime

1.8.0 · Source§

impl StructuralPartialEq for SystemTime

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<'a, T> Choice<'a> for T
where T: Decode<'a> + FixedTag,

Source§

fn can_decode(tag: Tag) -> bool

Is the provided Tag decodable as a variant of this CHOICE?
Source§

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

Source§

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

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

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
Source§

impl<'a, T> Decode<'a> for T
where T: DecodeValue<'a> + FixedTag,

Source§

fn decode<R>(reader: &mut R) -> Result<T, Error>
where R: Reader<'a>,

Attempt to decode this message using the provided decoder.
Source§

fn from_der(bytes: &'a [u8]) -> Result<Self, Error>

Parse Self from the provided DER-encoded byte slice.
Source§

impl<T> DerOrd for T

Source§

fn der_cmp(&self, other: &T) -> Result<Ordering, Error>

Return an Ordering between self and other when serialized as ASN.1 DER.
Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> Encode for T
where T: EncodeValue + Tagged,

Source§

fn encoded_len(&self) -> Result<Length, Error>

Compute the length of this value in bytes when encoded as ASN.1 DER.

Source§

fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>

Encode this value as ASN.1 DER using the provided Writer.

Source§

fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>

Encode this value to the provided byte slice, returning a sub-slice containing the encoded message.
Source§

fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length, Error>

Available on crate feature alloc only.
Encode this message as ASN.1 DER, appending it to the provided byte vector.
Source§

fn to_der(&self) -> Result<Vec<u8>, Error>

Available on crate feature alloc only.
Encode this type as DER, returning a byte vector.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

Source§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
Source§

fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
Source§

fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<>
Source§

fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

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

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tagged for T
where T: FixedTag,

Source§

fn tag(&self) -> Tag

Get the ASN.1 tag that this type is encoded with.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ValueOrd for T
where T: OrdIsValueOrd,

Source§

fn value_cmp(&self, other: &T) -> Result<Ordering, Error>

Return an Ordering between value portion of TLV-encoded self and other when serialized as ASN.1 DER.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> Any for T
where T: Any,

§

impl<T> AsyncTraitDeps for T

Source§

impl<T> CloneAny for T
where T: Any + Clone,

Source§

impl<T> CloneAnySend for T
where T: Any + Send + Clone,

Source§

impl<T> CloneAnySendSync for T
where T: Any + Send + Sync + Clone,

Source§

impl<T> CloneAnySync for T
where T: Any + Sync + Clone,

Source§

impl<T> DecodeOwned for T
where T: for<'a> Decode<'a>,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T, Rhs, Output> GroupOps<Rhs, Output> for T
where T: Add<Rhs, Output = Output> + Sub<Rhs, Output = Output> + AddAssign<Rhs> + SubAssign<Rhs>,

Source§

impl<T> MaybeSendSync for T

§

impl<T> SendOutsideWasm for T
where T: Send,

§

impl<T> SyncOutsideWasm for T
where T: Sync,