Struct SystemTime

1.8.0 ยท Source
pub struct SystemTime(/* private fields */);
Available on crate feature std only.
Expand description

๐Ÿ•˜ std A measurement of the system clock.

Re-exported from std::time:: .


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) => {
           // the system clock went backwards!
           println!("Great Scott! {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.
1.9.0 ยท Sourceยง

impl AddAssign<Duration> for SystemTime

Sourceยง

fn add_assign(&mut self, other: Duration)

Performs the += operation. Read more
Sourceยง

impl BitSized<128> for SystemTime

Sourceยง

const BIT_SIZE: usize = _

The bit size of this type (only the relevant data part, without padding). Read more
Sourceยง

const MIN_BYTE_SIZE: usize = _

The rounded up byte size for this type. Read more
Sourceยง

fn bit_size(&self) -> usize

Returns the bit size of this type (only the relevant data part, without padding). Read more
Sourceยง

fn min_byte_size(&self) -> usize

Returns the rounded up byte size for this type. 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
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<'de> Deserialize<'de> for SystemTime

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 From<Timestamp> for SystemTime

Sourceยง

fn from(time: Timestamp) -> SystemTime

Converts to this type from the input type.
Sourceยง

impl From<Zoned> for SystemTime

Sourceยง

fn from(time: Zoned) -> SystemTime

Converts to this type from the input type.
Sourceยง

impl FromPyObject<'_> for SystemTime

Sourceยง

fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<SystemTime, PyErr> โ“˜

Extracts Self from the bound smart pointer obj. Read more
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 IntoPy<Py<PyAny>> for SystemTime

Sourceยง

fn into_py(self, py: Python<'_>) -> Py<PyAny>

๐Ÿ‘ŽDeprecated since 0.23.0: IntoPy is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
Performs the conversion.
Sourceยง

impl<'py> IntoPyObject<'py> for &SystemTime

Sourceยง

type Target = PyAny

The Python output type
Sourceยง

type Output = Bound<'py, <&SystemTime as IntoPyObject<'py>>::Target>

The smart pointer type to use. Read more
Sourceยง

type Error = PyErr

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

fn into_pyobject( self, py: Python<'py>, ) -> Result<<&SystemTime as IntoPyObject<'py>>::Output, <&SystemTime as IntoPyObject<'py>>::Error> โ“˜

Performs the conversion.
Sourceยง

impl<'py> IntoPyObject<'py> for SystemTime

Sourceยง

type Target = PyAny

The Python output type
Sourceยง

type Output = Bound<'py, <SystemTime as IntoPyObject<'py>>::Target>

The smart pointer type to use. Read more
Sourceยง

type Error = PyErr

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

fn into_pyobject( self, py: Python<'py>, ) -> Result<<SystemTime as IntoPyObject<'py>>::Output, <SystemTime as IntoPyObject<'py>>::Error> โ“˜

Performs the conversion.
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
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.
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

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
1.9.0 ยท Sourceยง

impl SubAssign<Duration> for SystemTime

Sourceยง

fn sub_assign(&mut self, other: Duration)

Performs the -= operation. Read more
Sourceยง

impl TimeSource<false> for SystemTime

Sourceยง

fn granularity() -> Enum<2, TimeGranularity, Ratio<u32, u32>>

Returns the granularity of this time source.
Sourceยง

fn now_millis() -> u64

Returns the current timestamp in milliseconds.
Sourceยง

fn now_micros() -> u64

Returns the current timestamp in microseconds. Read more
Sourceยง

fn now_nanos() -> u64

Returns the current timestamp in nanoseconds. Read more
Sourceยง

fn epoch_millis() -> u64

Returns the epoch offset in milliseconds. Read more
Sourceยง

fn epoch_micros() -> u64

Returns the epoch offset in microseconds. Read more
Sourceยง

fn epoch_nanos() -> u64

Returns the epoch offset in nanoseconds. Read more
Sourceยง

fn now_millis_f64() -> f64 โ“˜

Returns the current timestamp as an f64 value in milliseconds. Read more
Sourceยง

fn epoch_millis_f64() -> f64 โ“˜

Returns the current timestamp as an f64 value in milliseconds. Read more
Sourceยง

impl ToPyObject for SystemTime

Sourceยง

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

๐Ÿ‘ŽDeprecated since 0.23.0: ToPyObject is going to be replaced by IntoPyObject. See the migration guide (https://pyo3.rs/v0.23.0/migration) for more information.
Converts self into a Python object.
Sourceยง

impl TryFrom<SystemTime> for Timestamp

Sourceยง

type Error = Error

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

fn try_from(system_time: SystemTime) -> Result<Timestamp, Error> โ“˜

Performs the conversion.
Sourceยง

impl TryFrom<SystemTime> for UnixTimeI64

Sourceยง

type Error = SystemTimeError

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

fn try_from(time: SystemTime) -> Result<Self, Self::Error> โ“˜

Performs the conversion.
Sourceยง

impl TryFrom<SystemTime> for UnixTimeU32

Available on crate features cast and error only.
Sourceยง

type Error = TimeError

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

fn try_from(time: SystemTime) -> Result<Self, Self::Error> โ“˜

Performs the conversion.
Sourceยง

impl TryFrom<SystemTime> for Zoned

Sourceยง

type Error = Error

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

fn try_from(system_time: SystemTime) -> Result<Zoned, Error> โ“˜

Performs the conversion.
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<T> ByteSized for T

Sourceยง

const BYTE_ALIGN: usize = _

The alignment of this type in bytes.
Sourceยง

const BYTE_SIZE: usize = _

The size of this type in bytes.
Sourceยง

fn byte_align(&self) -> usize

Returns the alignment of this type in bytes.
Sourceยง

fn byte_size(&self) -> usize

Returns the size of this type in bytes. Read more
Sourceยง

fn ptr_size_ratio(&self) -> [usize; 2]

Returns the size ratio between Ptr::BYTES and BYTE_SIZE. Read more
Sourceยง

impl<T, R> Chain<R> for T
where T: ?Sized,

Sourceยง

fn chain<F>(self, f: F) -> R
where F: FnOnce(Self) -> R, Self: Sized,

Chain a function which takes the parameter by value.
Sourceยง

fn chain_ref<F>(&self, f: F) -> R
where F: FnOnce(&Self) -> R,

Chain a function which takes the parameter by shared reference.
Sourceยง

fn chain_mut<F>(&mut self, f: F) -> R
where F: FnOnce(&mut Self) -> R,

Chain a function which takes the parameter by exclusive reference.
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<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.
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<T> ExtAny for T
where T: Any + ?Sized,

Sourceยง

fn type_id() -> TypeId

Returns the TypeId of Self. Read more
Sourceยง

fn type_of(&self) -> TypeId

Returns the TypeId of self. Read more
Sourceยง

fn type_name(&self) -> &'static str โ“˜

Returns the type name of self. Read more
Sourceยง

fn type_is<T: 'static>(&self) -> bool

Returns true if Self is of type T. Read more
Sourceยง

fn type_hash(&self) -> u64

Returns a deterministic hash of the TypeId of Self.
Sourceยง

fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64

Returns a deterministic hash of the TypeId of Self using a custom hasher.
Sourceยง

fn as_any_ref(&self) -> &dyn Any
where Self: Sized,

Upcasts &self as &dyn Any. Read more
Sourceยง

fn as_any_mut(&mut self) -> &mut dyn Any
where Self: Sized,

Upcasts &mut self as &mut dyn Any. Read more
Sourceยง

fn as_any_box(self: Box<Self>) -> Box<dyn Any>
where Self: Sized,

Upcasts Box<self> as Box<dyn Any>. Read more
Sourceยง

fn downcast_ref<T: 'static>(&self) -> Option<&T> โ“˜

Available on crate feature unsafe_layout only.
Returns some shared reference to the inner value if it is of type T. Read more
Sourceยง

fn downcast_mut<T: 'static>(&mut self) -> Option<&mut T> โ“˜

Available on crate feature unsafe_layout only.
Returns some exclusive reference to the inner value if it is of type T. Read more
Sourceยง

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

Sourceยง

const NEEDS_DROP: bool = _

Know whether dropping values of this type matters, in compile-time.
Sourceยง

fn mem_align_of<T>() -> usize

Returns the minimum alignment of the type in bytes. Read more
Sourceยง

fn mem_align_of_val(&self) -> usize

Returns the alignment of the pointed-to value in bytes. Read more
Sourceยง

fn mem_size_of<T>() -> usize

Returns the size of a type in bytes. Read more
Sourceยง

fn mem_size_of_val(&self) -> usize

Returns the size of the pointed-to value in bytes. Read more
Sourceยง

fn mem_copy(&self) -> Self
where Self: Copy,

Bitwise-copies a value. Read more
Sourceยง

fn mem_needs_drop(&self) -> bool

Returns true if dropping values of this type matters. Read more
Sourceยง

fn mem_drop(self)
where Self: Sized,

Drops self by running its destructor. Read more
Sourceยง

fn mem_forget(self)
where Self: Sized,

Forgets about self without running its destructor. Read more
Sourceยง

fn mem_replace(&mut self, other: Self) -> Self
where Self: Sized,

Replaces self with other, returning the previous value of self. Read more
Sourceยง

fn mem_take(&mut self) -> Self
where Self: Default,

Replaces self with its default value, returning the previous value of self. Read more
Sourceยง

fn mem_swap(&mut self, other: &mut Self)
where Self: Sized,

Swaps the value of self and other without deinitializing either one. Read more
Sourceยง

unsafe fn mem_zeroed<T>() -> T

Available on crate feature unsafe_layout only.
Returns the value of type T represented by the all-zero byte-pattern. Read more
Sourceยง

unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst

Available on crate feature unsafe_layout only.
Returns the value of type T represented by the all-zero byte-pattern. Read more
Sourceยง

fn mem_as_bytes(&self) -> &[u8] โ“˜
where Self: Sync + Unpin,

Available on crate feature unsafe_slice only.
View a Sync + Unpin self as &[u8]. Read more
Sourceยง

fn mem_as_bytes_mut(&mut self) -> &mut [u8] โ“˜
where Self: Sync + Unpin,

Available on crate feature unsafe_slice only.
View a Sync + Unpin self as &mut [u8]. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<'py, T> FromPyObjectBound<'_, 'py> for T
where T: FromPyObject<'py>,

Sourceยง

fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr> โ“˜

Extracts Self from the bound smart pointer obj. Read more
Sourceยง

impl<S> FromSample<S> for S

Sourceยง

impl<T> Hook for T

Sourceยง

fn hook_ref<F>(self, f: F) -> Self
where F: FnOnce(&Self),

Applies a function which takes the parameter by shared reference, and then returns the (possibly) modified owned value. Read more
Sourceยง

fn hook_mut<F>(self, f: F) -> Self
where F: FnOnce(&mut Self),

Applies a function which takes the parameter by exclusive reference, and then returns the (possibly) modified owned value. 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<'py, T> IntoPyObjectExt<'py> for T
where T: IntoPyObject<'py>,

Sourceยง

fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr> โ“˜

Converts self into an owned Python object, dropping type information.
Sourceยง

fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr> โ“˜

Converts self into an owned Python object, dropping type information and unbinding it from the 'py lifetime.
Sourceยง

fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr> โ“˜

Converts self into a Python object. Read more
Sourceยง

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Sourceยง

impl<T> Pointable for T

Sourceยง

const ALIGN: usize

The alignment of pointer.
Sourceยง

type Init = T

The type for initializers.
Sourceยง

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Sourceยง

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Sourceยง

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Sourceยง

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Sourceยง

impl<T> PyErrArguments for T
where T: for<'py> IntoPyObject<'py> + Send + Sync,

Sourceยง

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
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> ToSample<U> for T
where U: FromSample<T>,

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Sourceยง

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Sourceยง

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