MutRefGuard

Struct MutRefGuard 

Source
pub struct MutRefGuard<'a, V> { /* private fields */ }
Expand description

Mutable guard without value lock, only structure lock (mutable access) 无值锁的可变守护者,只有结构锁(可变访问)

§Safety

此结构绕过了保护值的 RwLock,仅当您确定没有其他线程正在修改该值时才应使用。 This struct bypasses the RwLock protecting the value. It should only be used when you are sure that no other thread is modifying the value.

Trait Implementations§

Source§

impl<'a, V> AsMut<V> for MutRefGuard<'a, V>

Source§

fn as_mut(&mut self) -> &mut V

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<'a, V> AsRef<V> for MutRefGuard<'a, V>

Source§

fn as_ref(&self) -> &V

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a, V> Debug for MutRefGuard<'a, V>
where V: Debug,

Source§

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

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

impl<'a, V> Deref for MutRefGuard<'a, V>

Source§

type Target = V

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a, V> DerefMut for MutRefGuard<'a, V>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'a, V> Display for MutRefGuard<'a, V>
where V: Display,

Source§

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

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

impl<'a, V> PartialEq for MutRefGuard<'a, V>
where V: PartialEq,

Source§

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

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

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

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

impl<'a, V> Eq for MutRefGuard<'a, V>
where V: Eq,

Auto Trait Implementations§

§

impl<'a, V> Freeze for MutRefGuard<'a, V>

§

impl<'a, V> RefUnwindSafe for MutRefGuard<'a, V>
where V: RefUnwindSafe,

§

impl<'a, V> Send for MutRefGuard<'a, V>
where V: Send,

§

impl<'a, V> Sync for MutRefGuard<'a, V>
where V: Sync,

§

impl<'a, V> Unpin for MutRefGuard<'a, V>

§

impl<'a, V> !UnwindSafe for MutRefGuard<'a, V>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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
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.