ShareSync

Struct ShareSync 

Source
pub struct ShareSync;
Expand description

A thread-safe ShareKind

Trait Implementations§

Source§

impl ShareKind for ShareSync

Source§

type Inner<T> = Arc<RwLock<RawRwLock, T>>

The inner wrapper, usually a smart pointer wrapping something with interior mutability
Source§

type GuardKind = GuardSync

The guard kind
Source§

fn make<T>(t: T) -> Self::Inner<T>

Make a new inner value
Source§

fn read<T>( inner: &Self::Inner<T>, ) -> <Self::GuardKind as GuardKind>::ReadGuard<'_, T>

Get a read-only guard to the value
Source§

fn write<T>( inner: &mut Self::Inner<T>, ) -> <Self::GuardKind as GuardKind>::WriteGuard<'_, T>

Get a read-write guard to the value
Source§

fn try_read<T>( inner: &Self::Inner<T>, ) -> Option<<Self::GuardKind as GuardKind>::ReadGuard<'_, T>>

Try to get a read-only guard to the value
Source§

fn try_write<T>( inner: &mut Self::Inner<T>, ) -> Option<<Self::GuardKind as GuardKind>::WriteGuard<'_, T>>

Try to get a read-write guard to the value
Source§

fn as_mut<T>(inner: &mut Self::Inner<T>) -> Option<&mut T>

Try to get a mutable reference to the value Read more
Source§

fn try_unwrap<T>(inner: Self::Inner<T>) -> Result<T, Self::Inner<T>>

Try to unwrap the inner value
Source§

fn ptr_eq<T, U>(a: &Self::Inner<T>, b: &Self::Inner<U>) -> bool

Compare two inner values for pointer equality
Source§

fn ptr_cmp<T, U>(a: &Self::Inner<T>, b: &Self::Inner<U>) -> Ordering

Compare two inner values for pointer ordering
Source§

fn ptr_hash<T, H: Hasher>(inner: &Self::Inner<T>, state: &mut H)

Hash an inner value by pointer
Source§

fn make_mut<T: Clone>(inner: &mut Self::Inner<T>) -> &mut T

Get a mutable reference to the value, cloning it if necessary

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> 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, 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.