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) => {
// 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:
| Platform | System call |
|---|---|
| SGX | insecure_time usercall. More information on timekeeping in SGX |
| UNIX | clock_gettime (Realtime Clock) |
| WASI | clock_gettime (Realtime Clock) |
| Darwin | clock_gettime (Realtime Clock) |
| VXWorks | clock_gettime (Realtime Clock) |
| SOLID | SOLID_RTC_ReadTime |
| Windows | GetSystemTimePreciseAsFileTime / GetSystemTimeAsFileTime |
Disclaimer: These system calls might change over time.
Note: mathematical operations like
addmay panic if the underlying structure cannot represent the new point in time.
Implementations§
Source§impl SystemTime
impl SystemTime
1.28.0 · Sourcepub const UNIX_EPOCH: SystemTime = UNIX_EPOCH
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!"),
}Sourcepub const MAX: SystemTime
🔬This is a nightly-only experimental API. (time_systemtime_limits)
pub const MAX: SystemTime
time_systemtime_limits)Represents the maximum value representable by SystemTime on this platform.
This value differs a lot between platforms, but it is always the case
that any positive addition of a Duration, whose value is greater
than or equal to the time precision of the operating system, to
SystemTime::MAX will fail.
§Examples
#![feature(time_systemtime_limits)]
use std::time::{Duration, SystemTime};
// Adding zero will change nothing.
assert_eq!(SystemTime::MAX.checked_add(Duration::ZERO), Some(SystemTime::MAX));
// But adding just one second will already fail ...
//
// Keep in mind that this in fact may succeed, if the Duration is
// smaller than the time precision of the operating system, which
// happens to be 1ns on most operating systems, with Windows being the
// notable exception by using 100ns, hence why this example uses 1s.
assert_eq!(SystemTime::MAX.checked_add(Duration::new(1, 0)), None);
// Utilize this for saturating arithmetic to improve error handling.
// In this case, we will use a certificate with a timestamp in the
// future as a practical example.
let configured_offset = Duration::from_secs(60 * 60 * 24);
let valid_after =
SystemTime::now()
.checked_add(configured_offset)
.unwrap_or(SystemTime::MAX);Sourcepub const MIN: SystemTime
🔬This is a nightly-only experimental API. (time_systemtime_limits)
pub const MIN: SystemTime
time_systemtime_limits)Represents the minimum value representable by SystemTime on this platform.
This value differs a lot between platforms, but it is always the case
that any positive subtraction of a Duration from, whose value is
greater than or equal to the time precision of the operating system, to
SystemTime::MIN will fail.
Depending on the platform, this may be either less than or equal to
SystemTime::UNIX_EPOCH, depending on whether the operating system
supports the representation of timestamps before the Unix epoch or not.
However, it is always guaranteed that a SystemTime::UNIX_EPOCH fits
between a SystemTime::MIN and SystemTime::MAX.
§Examples
#![feature(time_systemtime_limits)]
use std::time::{Duration, SystemTime};
// Subtracting zero will change nothing.
assert_eq!(SystemTime::MIN.checked_sub(Duration::ZERO), Some(SystemTime::MIN));
// But subtracting just one second will already fail.
//
// Keep in mind that this in fact may succeed, if the Duration is
// smaller than the time precision of the operating system, which
// happens to be 1ns on most operating systems, with Windows being the
// notable exception by using 100ns, hence why this example uses 1s.
assert_eq!(SystemTime::MIN.checked_sub(Duration::new(1, 0)), None);
// Utilize this for saturating arithmetic to improve error handling.
// In this case, we will use a cache expiry as a practical example.
let configured_expiry = Duration::from_secs(60 * 3);
let expiry_threshold =
SystemTime::now()
.checked_sub(configured_expiry)
.unwrap_or(SystemTime::MIN);1.8.0 · Sourcepub fn now() -> SystemTime
pub fn now() -> SystemTime
Returns the system time corresponding to “now”.
§Examples
use std::time::SystemTime;
let sys_time = SystemTime::now();1.8.0 · Sourcepub fn duration_since(
&self,
earlier: SystemTime,
) -> Result<Duration, SystemTimeError>
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 · Sourcepub fn elapsed(&self) -> Result<Duration, SystemTimeError>
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 · Sourcepub fn checked_add(&self, duration: Duration) -> Option<SystemTime>
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.
In the case that the duration is smaller than the time precision of the operating
system, Some(self) will be returned.
1.34.0 · Sourcepub fn checked_sub(&self, duration: Duration) -> Option<SystemTime>
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.
In the case that the duration is smaller than the time precision of the operating
system, Some(self) will be returned.
Sourcepub fn saturating_add(&self, duration: Duration) -> SystemTime
🔬This is a nightly-only experimental API. (time_saturating_systemtime)
pub fn saturating_add(&self, duration: Duration) -> SystemTime
time_saturating_systemtime)Saturating SystemTime addition, computing self + duration,
returning SystemTime::MAX if overflow occurred.
In the case that the duration is smaller than the time precision of
the operating system, self will be returned.
Sourcepub fn saturating_sub(&self, duration: Duration) -> SystemTime
🔬This is a nightly-only experimental API. (time_saturating_systemtime)
pub fn saturating_sub(&self, duration: Duration) -> SystemTime
time_saturating_systemtime)Saturating SystemTime subtraction, computing self - duration,
returning SystemTime::MIN if overflow occurred.
In the case that the duration is smaller than the time precision of
the operating system, self will be returned.
Sourcepub fn saturating_duration_since(&self, earlier: SystemTime) -> Duration
🔬This is a nightly-only experimental API. (time_saturating_systemtime)
pub fn saturating_duration_since(&self, earlier: SystemTime) -> Duration
time_saturating_systemtime)Saturating computation of time elapsed from an earlier point in time,
returning Duration::ZERO in the case that earlier is later or
equal to self.
§Examples
#![feature(time_saturating_systemtime)]
use std::time::{Duration, SystemTime};
let now = SystemTime::now();
let prev = now.saturating_sub(Duration::new(1, 0));
// now - prev should return non-zero.
assert_eq!(now.saturating_duration_since(prev), Duration::new(1, 0));
assert!(now.duration_since(prev).is_ok());
// prev - now should return zero (and fail with the non-saturating).
assert_eq!(prev.saturating_duration_since(now), Duration::ZERO);
assert!(prev.duration_since(now).is_err());
// now - now should return zero (and work with the non-saturating).
assert_eq!(now.saturating_duration_since(now), Duration::ZERO);
assert!(now.duration_since(now).is_ok());Trait Implementations§
1.8.0 · Source§impl Add<Duration> for SystemTime
impl Add<Duration> for SystemTime
Source§fn add(self, dur: Duration) -> SystemTime
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
type Output = SystemTime
+ operator.Source§impl Add<Duration> for SystemTime
Available on crate feature std only.
impl Add<Duration> for SystemTime
std only.1.9.0 · Source§impl AddAssign<Duration> for SystemTime
impl AddAssign<Duration> for SystemTime
Source§fn add_assign(&mut self, other: Duration)
fn add_assign(&mut self, other: Duration)
+= operation. Read moreSource§impl AddAssign<Duration> for SystemTime
Available on crate feature std only.
impl AddAssign<Duration> for SystemTime
std only.Source§fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
+= operation. Read more1.8.0 · Source§impl Clone for SystemTime
impl Clone for SystemTime
Source§fn clone(&self) -> SystemTime
fn clone(&self) -> SystemTime
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SystemTime
1.8.0 · Source§impl Debug for SystemTime
impl Debug for SystemTime
Source§impl<'a> DecodeValue<'a> for SystemTime
Available on crate feature std only.
impl<'a> DecodeValue<'a> for SystemTime
std only.Source§fn decode_value<R>(reader: &mut R, header: Header) -> Result<SystemTime, Error>where
R: Reader<'a>,
fn decode_value<R>(reader: &mut R, header: Header) -> Result<SystemTime, Error>where
R: Reader<'a>,
Reader.Source§impl<'a> DecodeValue<'a> for SystemTime
Available on crate feature std only.
impl<'a> DecodeValue<'a> for SystemTime
std only.Source§impl<'de> Deserialize<'de> for SystemTime
Available on crate feature std only.
impl<'de> Deserialize<'de> for SystemTime
std only.Source§fn deserialize<D>(
deserializer: D,
) -> Result<SystemTime, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<SystemTime, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl EncodeValue for SystemTime
Available on crate feature std only.
impl EncodeValue for SystemTime
std only.Source§impl EncodeValue for SystemTime
Available on crate feature std only.
impl EncodeValue for SystemTime
std only.impl Eq for SystemTime
Source§impl FixedTag for SystemTime
Available on crate feature std only.
impl FixedTag for SystemTime
std only.Source§impl FixedTag for SystemTime
Available on crate feature std only.
impl FixedTag for SystemTime
std only.Source§impl From<&DateTime> for SystemTime
Available on crate feature std only.
impl From<&DateTime> for SystemTime
std only.Source§fn from(time: &DateTime) -> SystemTime
fn from(time: &DateTime) -> SystemTime
Source§impl From<&DateTime> for SystemTime
Available on crate feature std only.
impl From<&DateTime> for SystemTime
std only.Source§fn from(time: &DateTime) -> SystemTime
fn from(time: &DateTime) -> SystemTime
Source§impl From<&GeneralizedTime> for SystemTime
Available on crate feature std only.
impl From<&GeneralizedTime> for SystemTime
std only.Source§fn from(time: &GeneralizedTime) -> SystemTime
fn from(time: &GeneralizedTime) -> SystemTime
Source§impl From<&GeneralizedTime> for SystemTime
Available on crate feature std only.
impl From<&GeneralizedTime> for SystemTime
std only.Source§fn from(time: &GeneralizedTime) -> SystemTime
fn from(time: &GeneralizedTime) -> SystemTime
Source§impl From<&Time> for SystemTime
Available on crate feature std only.
impl From<&Time> for SystemTime
std only.Source§fn from(time: &Time) -> SystemTime
fn from(time: &Time) -> SystemTime
Source§impl From<Date> for SystemTime
impl From<Date> for SystemTime
Source§fn from(this: Date) -> SystemTime
fn from(this: Date) -> SystemTime
Source§impl From<Date> for SystemTime
impl From<Date> for SystemTime
Source§fn from(val: Date) -> SystemTime
fn from(val: Date) -> SystemTime
Source§impl<Tz> From<DateTime<Tz>> for SystemTimewhere
Tz: TimeZone,
Available on crate feature std only.
impl<Tz> From<DateTime<Tz>> for SystemTimewhere
Tz: TimeZone,
std only.Source§fn from(dt: DateTime<Tz>) -> SystemTime
fn from(dt: DateTime<Tz>) -> SystemTime
Source§impl From<DateTime> for SystemTime
Available on crate feature std only.
impl From<DateTime> for SystemTime
std only.Source§fn from(time: DateTime) -> SystemTime
fn from(time: DateTime) -> SystemTime
Source§impl From<DateTime> for SystemTime
impl From<DateTime> for SystemTime
Source§fn from(dt: DateTime) -> SystemTime
fn from(dt: DateTime) -> SystemTime
Source§impl From<DateTime> for SystemTime
Available on crate feature std only.
impl From<DateTime> for SystemTime
std only.Source§fn from(time: DateTime) -> SystemTime
fn from(time: DateTime) -> SystemTime
Source§impl From<DateTime> for SystemTime
impl From<DateTime> for SystemTime
Source§fn from(dt: DateTime) -> SystemTime
fn from(dt: DateTime) -> SystemTime
Source§impl From<GeneralizedTime> for SystemTime
Available on crate feature std only.
impl From<GeneralizedTime> for SystemTime
std only.Source§fn from(time: GeneralizedTime) -> SystemTime
fn from(time: GeneralizedTime) -> SystemTime
Source§impl From<GeneralizedTime> for SystemTime
Available on crate feature std only.
impl From<GeneralizedTime> for SystemTime
std only.Source§fn from(time: GeneralizedTime) -> SystemTime
fn from(time: GeneralizedTime) -> SystemTime
Source§impl From<HttpDate> for SystemTime
impl From<HttpDate> for SystemTime
Source§fn from(v: HttpDate) -> SystemTime
fn from(v: HttpDate) -> SystemTime
Source§impl From<Iso8601TimeNoSp> for SystemTime
impl From<Iso8601TimeNoSp> for SystemTime
Source§fn from(value: Iso8601TimeNoSp) -> SystemTime
fn from(value: Iso8601TimeNoSp) -> SystemTime
Source§impl From<Iso8601TimeSlug> for SystemTime
impl From<Iso8601TimeSlug> for SystemTime
Source§fn from(value: Iso8601TimeSlug) -> SystemTime
fn from(value: Iso8601TimeSlug) -> SystemTime
Source§impl From<Iso8601TimeSp> for SystemTime
impl From<Iso8601TimeSp> for SystemTime
Source§fn from(value: Iso8601TimeSp) -> SystemTime
fn from(value: Iso8601TimeSp) -> SystemTime
Source§impl From<OffsetDateTime> for SystemTime
impl From<OffsetDateTime> for SystemTime
Source§fn from(datetime: OffsetDateTime) -> SystemTime
fn from(datetime: OffsetDateTime) -> SystemTime
Source§impl From<SystemTime> for SystemTime
impl From<SystemTime> for SystemTime
Source§fn from(value: SystemTime) -> SystemTime
fn from(value: SystemTime) -> SystemTime
§Panics
If the result cannot be represented
Source§impl From<Time> for SystemTime
Available on crate feature std only.
impl From<Time> for SystemTime
std only.Source§fn from(time: Time) -> SystemTime
fn from(time: Time) -> SystemTime
Source§impl From<Timestamp> for SystemTime
Available on crate feature std only.
impl From<Timestamp> for SystemTime
std only.Source§fn from(ts: Timestamp) -> SystemTime
fn from(ts: Timestamp) -> SystemTime
Perform the conversion.
If the conversion would fail, an undefined SystemTime will be returned instead.
This can happen if the Timestamp would overflow the max value allowed by SystemTime on the target platform.
Use TryFrom to catch conversion failures and handle them explicitly.
Source§impl From<Timestamp> for SystemTime
impl From<Timestamp> for SystemTime
Source§fn from(val: Timestamp) -> SystemTime
fn from(val: Timestamp) -> SystemTime
Source§impl From<UnixTime> for SystemTime
Available on crate feature std only.
impl From<UnixTime> for SystemTime
std only.Source§fn from(unix_time: UnixTime) -> SystemTime
fn from(unix_time: UnixTime) -> SystemTime
Source§impl From<UtcDateTime> for SystemTime
impl From<UtcDateTime> for SystemTime
Source§fn from(datetime: UtcDateTime) -> SystemTime
fn from(datetime: UtcDateTime) -> SystemTime
Source§impl From<UtcTime> for SystemTime
Available on crate feature std only.
impl From<UtcTime> for SystemTime
std only.Source§fn from(utc_time: UtcTime) -> SystemTime
fn from(utc_time: UtcTime) -> SystemTime
Source§impl From<UtcTime> for SystemTime
Available on crate feature std only.
impl From<UtcTime> for SystemTime
std only.Source§fn from(utc_time: UtcTime) -> SystemTime
fn from(utc_time: UtcTime) -> SystemTime
Source§impl<'a> FromSql<'a> for SystemTime
impl<'a> FromSql<'a> for SystemTime
Source§fn from_sql(
_: &Type,
raw: &'a [u8],
) -> Result<SystemTime, Box<dyn Error + Sync + Send>>
fn from_sql( _: &Type, raw: &'a [u8], ) -> Result<SystemTime, Box<dyn Error + Sync + Send>>
Type in its binary format. Read moreSource§fn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Type.Source§impl<'a> FromSqlText<'a> for SystemTime
Available on crate feature pg-type-chrono only.
impl<'a> FromSqlText<'a> for SystemTime
pg-type-chrono only.Source§fn from_sql_text(
_ty: &Type,
value: &[u8],
_format_options: &FormatOptions,
) -> Result<SystemTime, Box<dyn Error + Sync + Send>>where
SystemTime: Sized,
fn from_sql_text(
_ty: &Type,
value: &[u8],
_format_options: &FormatOptions,
) -> Result<SystemTime, Box<dyn Error + Sync + Send>>where
SystemTime: Sized,
1.8.0 · Source§impl Hash for SystemTime
impl Hash for SystemTime
Source§impl JsonSchema for SystemTime
Available on crate feature std only.
impl JsonSchema for SystemTime
std only.Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more1.8.0 · Source§impl Ord for SystemTime
impl Ord for SystemTime
Source§fn cmp(&self, other: &SystemTime) -> Ordering
fn cmp(&self, other: &SystemTime) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
1.8.0 · Source§impl PartialEq for SystemTime
impl PartialEq for SystemTime
Source§impl PartialEq<OffsetDateTime> for SystemTime
impl PartialEq<OffsetDateTime> for SystemTime
Source§impl PartialEq<UtcDateTime> for SystemTime
impl PartialEq<UtcDateTime> for SystemTime
1.8.0 · Source§impl PartialOrd for SystemTime
impl PartialOrd for SystemTime
Source§impl PartialOrd<OffsetDateTime> for SystemTime
impl PartialOrd<OffsetDateTime> for SystemTime
Source§impl PartialOrd<UtcDateTime> for SystemTime
impl PartialOrd<UtcDateTime> for SystemTime
Source§impl Serialize for SystemTime
Available on crate feature std only.
impl Serialize for SystemTime
std only.Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl StructuralPartialEq for SystemTime
1.8.0 · Source§impl Sub<Duration> for SystemTime
impl Sub<Duration> for SystemTime
Source§type Output = SystemTime
type Output = SystemTime
- operator.Source§impl Sub<Duration> for SystemTime
Available on crate feature std only.
impl Sub<Duration> for SystemTime
std only.Source§impl Sub<OffsetDateTime> for SystemTime
impl Sub<OffsetDateTime> for SystemTime
Source§fn sub(self, rhs: OffsetDateTime) -> <SystemTime as Sub<OffsetDateTime>>::Output
fn sub(self, rhs: OffsetDateTime) -> <SystemTime as Sub<OffsetDateTime>>::Output
§Panics
This may panic if an overflow occurs.
Source§impl Sub<UtcDateTime> for SystemTime
impl Sub<UtcDateTime> for SystemTime
Source§fn sub(self, rhs: UtcDateTime) -> <SystemTime as Sub<UtcDateTime>>::Output
fn sub(self, rhs: UtcDateTime) -> <SystemTime as Sub<UtcDateTime>>::Output
§Panics
This may panic if an overflow occurs.
1.9.0 · Source§impl SubAssign<Duration> for SystemTime
impl SubAssign<Duration> for SystemTime
Source§fn sub_assign(&mut self, other: Duration)
fn sub_assign(&mut self, other: Duration)
-= operation. Read moreSource§impl SubAssign<Duration> for SystemTime
Available on crate feature std only.
impl SubAssign<Duration> for SystemTime
std only.Source§fn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
-= operation. Read moreSource§impl SystemTimeExt for SystemTime
impl SystemTimeExt for SystemTime
Source§fn checked_add_signed(&self, duration: Duration) -> Option<SystemTime>
fn checked_add_signed(&self, duration: Duration) -> Option<SystemTime>
Duration to the SystemTime, returning None is the result cannot be
represented by the underlying data structure.Source§fn checked_sub_signed(&self, duration: Duration) -> Option<SystemTime>
fn checked_sub_signed(&self, duration: Duration) -> Option<SystemTime>
Duration from the SystemTime, returning None is the result
cannot be represented by the underlying data structure.Source§fn signed_duration_since(&self, earlier: SystemTime) -> Duration
fn signed_duration_since(&self, earlier: SystemTime) -> Duration
SystemTime to this one. This will be
negative if earlier is later than self. Read moreSource§impl ToSql for SystemTime
impl ToSql for SystemTime
Source§fn to_sql(
&self,
_: &Type,
w: &mut BytesMut,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn to_sql( &self, _: &Type, w: &mut BytesMut, ) -> Result<IsNull, Box<dyn Error + Sync + Send>>
self into the binary format of the specified
Postgres Type, appending it to out. Read moreSource§fn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Type.Source§fn to_sql_checked(
&self,
ty: &Type,
out: &mut BytesMut,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut, ) -> Result<IsNull, Box<dyn Error + Sync + Send>>
Source§fn encode_format(&self, _ty: &Type) -> Format
fn encode_format(&self, _ty: &Type) -> Format
Source§impl ToSqlText for SystemTime
Available on crate feature pg-type-chrono only.
impl ToSqlText for SystemTime
pg-type-chrono only.Source§impl<'a> TryFrom<AnyRef<'a>> for SystemTime
Available on crate feature std only.
impl<'a> TryFrom<AnyRef<'a>> for SystemTime
std only.Source§impl<'a> TryFrom<AnyRef<'a>> for SystemTime
Available on crate feature std only.
impl<'a> TryFrom<AnyRef<'a>> for SystemTime
std only.Source§impl TryFrom<DateTime> for SystemTime
Tries to convert a DateTime into a SystemTime.
impl TryFrom<DateTime> for SystemTime
Tries to convert a DateTime into a SystemTime.
This can fail if the the DateTime value is larger or smaller than what the SystemTime
can represent on the operating system it’s compiled for. On Linux, for example, it will only
fail on Instant::from_secs(i64::MIN) (with any nanoseconds value). On Windows, however,
Rust’s standard library uses a smaller precision type for SystemTime, and it will fail
conversion for a much larger range of date-times. This is only an issue if dealing with
date-times beyond several thousands of years from now.
Source§type Error = ConversionError
type Error = ConversionError
Source§fn try_from(
date_time: DateTime,
) -> Result<SystemTime, <SystemTime as TryFrom<DateTime>>::Error>
fn try_from( date_time: DateTime, ) -> Result<SystemTime, <SystemTime as TryFrom<DateTime>>::Error>
Source§impl TryFrom<TimeExpr> for SystemTime
impl TryFrom<TimeExpr> for SystemTime
Source§impl TryFrom<Timestamp> for SystemTime
Available on crate feature std only.
impl TryFrom<Timestamp> for SystemTime
std only.Source§type Error = TimestampError
type Error = TimestampError
Source§fn try_from(
timestamp: Timestamp,
) -> Result<SystemTime, <SystemTime as TryFrom<Timestamp>>::Error>
fn try_from( timestamp: Timestamp, ) -> Result<SystemTime, <SystemTime as TryFrom<Timestamp>>::Error>
Auto Trait Implementations§
impl Freeze for SystemTime
impl RefUnwindSafe for SystemTime
impl Send for SystemTime
impl Sync for SystemTime
impl Unpin for SystemTime
impl UnsafeUnpin for SystemTime
impl UnwindSafe for SystemTime
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> BorrowToSql for Twhere
T: ToSql,
impl<T> BorrowToSql for Twhere
T: ToSql,
Source§fn borrow_to_sql(&self) -> &dyn ToSql
fn borrow_to_sql(&self) -> &dyn ToSql
self as a ToSql trait object.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
Source§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag + 'a,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag + 'a,
Source§type Error = <T as DecodeValue<'a>>::Error
type Error = <T as DecodeValue<'a>>::Error
Source§fn decode<R>(reader: &mut R) -> Result<T, <T as DecodeValue<'a>>::Error>where
R: Reader<'a>,
fn decode<R>(reader: &mut R) -> Result<T, <T as DecodeValue<'a>>::Error>where
R: Reader<'a>,
impl<T> DecodeOwned for Twhere
T: for<'a> Decode<'a>,
impl<T> DecodeOwned for Twhere
T: for<'a> Decode<'a>,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
Source§fn encoded_len(&self) -> Result<Length, Error>
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>
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>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Source§impl<T> Encode for T
impl<T> Encode for T
Source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Source§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.impl<T> FromSqlOwned for Twhere
T: for<'a> FromSql<'a>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
impl<T, Rhs, Output> GroupOps<Rhs, Output> for T
impl<T, Rhs, Output> GroupOps<Rhs, Output> for T
impl<T, Rhs, Output> GroupOps<Rhs, Output> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoAnyArc for T
impl<T> IntoAnyArc for T
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> ⓘ
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> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> IsConstructed for T
impl<T> IsConstructed for T
Source§const CONSTRUCTED: bool
const CONSTRUCTED: bool
impl<N> NodeTrait for N
impl<T> OrderedContainer<T> for Twhere
T: Clone,
Source§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);impl<P> Parameters for Pwhere
P: DeserializeOwned + JsonSchema,
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> RuleType for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.