Struct Guard

Source
pub(crate) struct Guard {
Show 21 fields id: GuardId, orports: Vec<SocketAddr>, pt_targets: Vec<PtTarget>, added_at: SystemTime, added_by: Option<CrateId>, disabled: Option<Futureproof<GuardDisabled>>, confirmed_at: Option<SystemTime>, unlisted_since: Option<SystemTime>, dir_info_missing: bool, last_tried_to_connect_at: Option<Instant>, retry_at: Option<Instant>, retry_schedule: Option<RetryDelay>, reachable: Reachable, is_dir_cache: bool, dir_status: DirStatus, exploratory_circ_pending: bool, circ_history: CircHistory, suspicious_behavior_warned: bool, clock_skew: Option<SkewObservation>, sensitivity: DisplayRule, unknown_fields: HashMap<String, JsonValue>,
}
Expand description

A single guard node, as held by the guard manager.

A Guard is a Tor relay that clients use for the first hop of their circuits. It doesn’t need to be a relay that’s currently on the network (that is, one that we could represent as a Relay): guards might be temporarily unlisted.

Some fields in guards are persistent; others are reset with every process.

§Identity

Every guard has at least one RelayId. A guard may gain identities over time, as we learn more about it, but it should never lose or change its identities of a given type.

§TODO

This structure uses Instant to represent non-persistent points in time, and SystemTime to represent points in time that need to be persistent. That’s possibly undesirable; maybe we should come up with a better solution.

Fields§

§id: GuardId

The identity keys for this guard.

§orports: Vec<SocketAddr>

The most recently seen addresses for this guard. If pt_targets is empty, these are the addresses we use for making OR connections to this guard directly. If pt_targets is nonempty, these are addresses at which the server is “located” (q.v. HasAddrs), but not ways to connect to it.

§pt_targets: Vec<PtTarget>

Any PtTarget instances that we know about for connecting to this guard over a pluggable transport.

If this is empty, then this guard only supports direct connections, at the locations in orports.

(Currently, this is always empty, or a singleton. If we find more than one, we only look at the first. It is a vector only for forward compatibility.)

§added_at: SystemTime

When, approximately, did we first add this guard to our sample?

§added_by: Option<CrateId>

What version of this crate added this guard to our sample?

§disabled: Option<Futureproof<GuardDisabled>>

If present, this guard is permanently disabled, and this object tells us why.

§confirmed_at: Option<SystemTime>

When, approximately, did we first successfully use this guard?

(We call a guard “confirmed” if we have successfully used it at least once.)

§unlisted_since: Option<SystemTime>

If this guard is not listed in the current-consensus, this is the valid_after date of the oldest consensus in which it was not listed.

A guard counts as “unlisted” if it is absent, unusable, or doesn’t have the Guard flag.

§dir_info_missing: bool

True if this guard is listed in the latest consensus, but we don’t have a microdescriptor for it.

§last_tried_to_connect_at: Option<Instant>

When did we last give out this guard in response to a request?

§retry_at: Option<Instant>

If this guard is currently Unreachable, when should we next retry it?

(Retrying a guard involves clearing this field, and setting reachable)

§retry_schedule: Option<RetryDelay>

Schedule use to determine when we can next attempt to connect to this guard.

§reachable: Reachable

Current reachability status for this guard.

§is_dir_cache: bool

If true, then the last time we saw a relay entry for this guard, it seemed like a valid directory cache.

§dir_status: DirStatus

Status for this guard, when used as a directory cache.

(This is separate from Reachable and retry_schedule, since being usable for circuit construction does not necessarily mean that the guard will have good, timely cache information. If it were not separate, then circuit success would clear directory failures.)

§exploratory_circ_pending: bool

If true, we have given this guard out for an exploratory circuit, and that exploratory circuit is still pending.

A circuit is “exploratory” if we launched it on a non-primary guard.

§circ_history: CircHistory

A count of all the circuit statuses we’ve seen on this guard.

Used to implement a lightweight version of path-bias detection.

§suspicious_behavior_warned: bool

True if we have warned about this guard behaving suspiciously.

§clock_skew: Option<SkewObservation>

Latest clock skew (if any) we have observed from this guard.

§sensitivity: DisplayRule

How should we display information about this guard?

§unknown_fields: HashMap<String, JsonValue>

Fields from the state file that was used to make this Guard that this version of Arti doesn’t understand.

Implementations§

Source§

impl Guard

Source

pub(crate) fn from_candidate( candidate: Candidate, now: SystemTime, params: &GuardParams, ) -> Self

Create a new unused Guard from a Candidate.

Source

fn from_chan_target<T>(relay: &T, now: SystemTime, params: &GuardParams) -> Self
where T: ChanTarget,

Create a new unused Guard from a ChanTarget.

This function doesn’t check whether the provided relay is a suitable guard node or not: that’s up to the caller to decide.

Source

fn new( id: GuardId, orports: Vec<SocketAddr>, pt_target: Option<PtTarget>, added_at: SystemTime, ) -> Self

Return a new, manually constructed Guard.

Source

pub(crate) fn guard_id(&self) -> &GuardId

Return the identity of this Guard.

Source

pub(crate) fn reachable(&self) -> Reachable

Return the reachability status for this guard.

Source

pub(crate) fn next_retry(&self, usage: &GuardUsage) -> Option<Instant>

Return the next time at which this guard will be retriable for a given usage.

(Return None if we think this guard might be reachable right now.)

Source

pub(crate) fn usable(&self) -> bool

Return true if this guard is usable and working according to our latest configuration and directory information, and hasn’t been turned off for some other reason.

Source

pub(crate) fn ready_for_usage(&self, usage: &GuardUsage, now: Instant) -> bool

Return true if this guard is ready (with respect to any timeouts) for the given usage at now.

Source

pub(crate) fn copy_ephemeral_status_into_newly_loaded_state( self, other: Guard, ) -> Guard

Copy all non-persistent status from other to self.

We do this when we were not the owner of our persistent state, and we have just reloaded it (as self), but we have some ephemeral knowledge about this guard (as other).

You should not invent new uses for this function; instead we should come up with alternatives.

§Panics

Panics if the identities in self are not exactly the same as the identities in other.

Source

fn set_reachable(&mut self, r: Reachable)

Change the reachability status for this guard.

Source

pub(crate) fn exploratory_circ_pending(&self) -> bool

Return true if at least one exploratory circuit is pending to this guard.

A circuit is “exploratory” if launched on a non-primary guard.

§TODO

The “exploratory” definition doesn’t quite match up with the behavior in the spec, but it is what Tor does.

Source

pub(crate) fn note_exploratory_circ(&mut self, pending: bool)

Note that an exploratory circuit is pending (if pending is true), or not pending (if pending is false.

Source

pub(crate) fn consider_retry(&mut self, now: Instant)

Possibly mark this guard as retriable, if it has been down for long enough.

Specifically, if the guard is to be Unreachable, and our last attempt to connect to it is far enough in the past from now, we change its status to Unknown.

Source

pub(crate) fn mark_retriable(&mut self)

If this guard is marked Unreachable, clear its unreachability status and mark it as Retriable.

Source

fn obeys_restrictions(&self, restrictions: &[GuardRestriction]) -> bool

Return true if this guard obeys all of the given restrictions.

Source

fn obeys_restriction(&self, r: &GuardRestriction) -> bool

Return true if this guard obeys a single restriction.

Source

pub(crate) fn conforms_to_usage(&self, usage: &GuardUsage) -> bool

Return true if this guard is suitable to use for the provided usage.

Source

pub(crate) fn listed_in<U: Universe>(&self, universe: &U) -> Option<bool>

Check whether this guard is listed in the provided sample::Universe.

Returns Some(true) if it is definitely listed, and Some(false) if it is definitely not listed. A None return indicates that we need to download more directory information about this guard before we can be certain whether this guard is listed or not.

Source

pub(crate) fn update_from_universe<U: Universe>(&mut self, universe: &U)

Change this guard’s status based on a newly received or newly updated sample::Universe.

A guard may become “listed” or “unlisted”: a listed guard is one that appears in the consensus with the Guard flag.

A guard may acquire additional identities if we learned them from the guard, either directly or via an authenticated directory document.

Additionally, a guard’s orports or pt_targets may change, if the universe lists a new address for the relay.

Source

fn mark_listed(&mut self)

Mark this guard as currently listed in the directory.

Source

fn mark_unlisted(&mut self, now: SystemTime)

Mark this guard as having been unlisted since now, if it is not already so marked.

Source

pub(crate) fn is_expired(&self, params: &GuardParams, now: SystemTime) -> bool

Return true if we should remove this guard from the current guard sample.

Guards may be ready for removal because they have been confirmed too long ago, if they have been sampled too long ago (if they are not confirmed), or if they have been unlisted for too long.

Source

pub(crate) fn record_failure(&mut self, now: Instant, is_primary: bool)

Record that a failure has happened for this guard.

If is_primary is true, this is a primary guard (q.v.).

Source

pub(crate) fn record_attempt(&mut self, connect_attempt: Instant)

Note that we have launch an attempted use of this guard.

We use this time to decide when to retry failing guards, and to see if the guard has been “pending” for a long time.

Source

pub(crate) fn exploratory_attempt_after(&self, when: Instant) -> bool

Return true if this guard has an exploratory circuit pending and if the most recent attempt to connect to it is after when.

See Self::exploratory_circ_pending.

Source

pub(crate) fn record_success( &mut self, now: SystemTime, params: &GuardParams, ) -> NewlyConfirmed

Note that a guard has been used successfully.

Updates that guard’s status to reachable, clears any failing status information for it, and decides whether the guard is newly confirmed.

If the guard is newly confirmed, the caller must add it to the list of confirmed guards.

Source

pub(crate) fn record_external_success(&mut self, how: ExternalActivity)

Record that an external operation has succeeded on this guard.

Source

pub(crate) fn record_external_failure( &mut self, how: ExternalActivity, now: Instant, )

Record that an external operation has failed on this guard.

Source

pub(crate) fn record_indeterminate_result(&mut self)

Note that a circuit through this guard died in a way that we couldn’t necessarily attribute to the guard.

Source

pub(crate) fn get_external_rep(&self, selection: GuardSetSelector) -> FirstHop

Return a FirstHop object to represent this guard.

Source

pub(crate) fn note_skew(&mut self, observation: SkewObservation)

Record that a given fallback has told us about clock skew.

Source

pub(crate) fn skew(&self) -> Option<&SkewObservation>

Return the most recent clock skew observation for this guard, if we have made one.

Trait Implementations§

Source§

impl ChanTarget for Guard

Source§

fn display_chan_target(&self) -> DisplayChanTarget<'_, Self>
where Self: Sized,

Return a reference to this object suitable for formatting its ChanTarget-specific members. Read more
Source§

impl Clone for Guard

Source§

fn clone(&self) -> Guard

Returns a duplicate 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 Debug for Guard

Source§

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

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

impl<'de> Deserialize<'de> for Guard

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

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

impl Display for Guard

Source§

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

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

impl HasAddrs for Guard

Source§

fn addrs(&self) -> &[SocketAddr]

Return the addresses listed for this server. Read more
Source§

impl HasChanMethod for Guard

Source§

fn chan_method(&self) -> ChannelMethod

Return the known ways to contact this
Source§

impl HasRelayIds for Guard

Source§

fn identity(&self, key_type: RelayIdType) -> Option<RelayIdRef<'_>>

Return the identity of this relay whose type is key_type, or None if the relay has no such identity. Read more
Source§

fn identities(&self) -> RelayIdIter<'_, Self>

Return an iterator over all of the identities held by this object.
Source§

fn ed_identity(&self) -> Option<&Ed25519Identity>

Return the ed25519 identity for this relay if it has one.
Source§

fn rsa_identity(&self) -> Option<&RsaIdentity>

Return the RSA identity for this relay if it has one.
Source§

fn has_identity(&self, id: RelayIdRef<'_>) -> bool

Check whether the provided Id is a known identity of this relay. Read more
Source§

fn has_any_identity(&self) -> bool

Return true if this object has any known identity.
Source§

fn same_relay_ids<T>(&self, other: &T) -> bool
where T: HasRelayIds + ?Sized,

Return true if this object has exactly the same relay IDs as other.
Source§

fn has_all_relay_ids_from<T>(&self, other: &T) -> bool
where T: HasRelayIds + ?Sized,

Return true if this object has every relay ID that other does. Read more
Source§

fn has_any_relay_id_from<T>(&self, other: &T) -> bool
where T: HasRelayIds + ?Sized,

Return true if this object has any relay ID that other has. Read more
Source§

fn cmp_by_relay_ids<T>(&self, other: &T) -> Ordering
where T: HasRelayIds + ?Sized,

Compare this object to another HasRelayIds. Read more
Source§

fn display_relay_ids(&self) -> DisplayRelayIds<'_, Self>

Return a reference to this object suitable for formatting its HasRelayIds members.
Source§

impl Serialize for Guard

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Guard

§

impl RefUnwindSafe for Guard

§

impl Send for Guard

§

impl Sync for Guard

§

impl Unpin for Guard

§

impl UnwindSafe for Guard

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

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

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

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

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

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

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

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

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

§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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
§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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<T> TryIntoSlug for T
where T: ToString + ?Sized,

Source§

fn try_into_slug(&self) -> Result<Slug, BadSlug>

Convert self into a Slug, if it has the right syntax
§

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

§

fn vzip(self) -> V

§

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

§

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

§

impl<T> MaybeSendSync for T