Struct rc_borrow::ArcBorrow

source ·
#[repr(transparent)]
pub struct ArcBorrow<'a, T: ?Sized> { /* private fields */ }
Expand description

Borrowed version of Arc.

This type is guaranteed to have the same repr as &T.

Implementations§

Convert this borrowed pointer into an owned pointer.

Convert this borrowed pointer into a weak pointer.

Convert this borrowed pointer into a standard reference.

This gives you a long-lived reference, whereas dereferencing gives a temporary borrow.

Get the number of strong owning pointers to this allocation.

Get the number of weak owning pointers to this allocation.

Get a raw pointer that can be used with from_raw.

Construct a new ArcBorrow from a raw pointer.

The raw pointer must have been previously returned by a call to ArcBorrow<U>::into_raw or Arc<U>::as_raw where U must have the same size and alignment as T. This is trivially true if U is T. Note that if U is not T, this is a pointer cast (transmute) between the two types, and the types must be transmute-compatible.

Trait Implementations§

Converts this type into a shared reference of the (usually inferred) input type.
Formats the value using the given formatter.
Immutably borrows from an owned value. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Formats the value using the given formatter. Read more
Turn this erasable pointer into an erased pointer. Read more
Unerase this erased pointer. Read more
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
Formats the value using the given formatter.
Formats the value using the given formatter.
Formats the value using the given formatter.
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Formats the value using the given formatter.
Returned iterator over socket addresses which this type may correspond to.
Converts this object to an iterator of resolved SocketAddrs. Read more
Formats the value using the given formatter.
Formats the value using the given formatter.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Unerase this erased pointer. Read more
Whether this implementor has acknowledged the 1.1.0 update to unerase’s documented implementation requirements. Read more
Turn this erasable pointer into an erased pointer. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.