rusty_mos::utils::sync_ref_cell

Struct SyncImplRef

Source
pub struct SyncImplRef<T: ?Sized>(pub RefCell<T>);
Expand description

The wrapper.

Tuple Fields§

§0: RefCell<T>

Implementations§

Source§

impl<T> SyncImplRef<T>

Source

pub const fn new(inner: T) -> Self

Default constructions. Put the target into the interior mutability container.

Source§

impl<T: ?Sized> SyncImplRef<T>

Source

pub fn borrow(&self) -> Ref<'_, T>

A convenient alias for borrow.

Source

pub fn borrow_mut(&self) -> RefMut<'_, T>

A convenient alias for mut borrow.

Trait Implementations§

Source§

impl<T: ?Sized> Sync for SyncImplRef<T>

For global use. The OS kernel itself is single-thread.

Auto Trait Implementations§

§

impl<T> !Freeze for SyncImplRef<T>

§

impl<T> !RefUnwindSafe for SyncImplRef<T>

§

impl<T> Send for SyncImplRef<T>
where T: Send + ?Sized,

§

impl<T> Unpin for SyncImplRef<T>
where T: Unpin + ?Sized,

§

impl<T> UnwindSafe for SyncImplRef<T>
where T: UnwindSafe + ?Sized,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.