pub struct Guarded<T> { /* private fields */ }
Expand description

Wrapper around a data T decrementing its underlying counter on Drop.

Implementations§

source§

impl<T> Guarded<T>

source

pub fn into_parts(self) -> (T, Guard)

Unwraps this Guarded into its inner value and its Guard.

source

pub fn into_inner(self) -> T

Unwraps this Guarded into its inner value dropping its Guard in-place.

source§

impl<T> Guarded<Option<T>>

source

pub fn transpose(self) -> Option<Guarded<T>>

Transposes an Guarded Option into a Option with a Guarded value within.

Trait Implementations§

source§

impl<T> AsRef<T> for Guarded<T>

source§

fn as_ref(&self) -> &T

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

impl<T: Debug> Debug for Guarded<T>

source§

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

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

impl<T> Deref for Guarded<T>

§

type Target = T

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<T> SubscribersStore<T, Guarded<T>> for SubStore<T>where T: Clone + 'static,

source§

fn send_update(&self, value: T)

Sends data update to the all subscribers.
source§

fn subscribe(&self) -> LocalBoxStream<'static, Guarded<T>>

Creates new updates subscription. Read more
source§

fn wrap(&self, value: T) -> Guarded<T>

Wraps the provided value to the output type.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for Guarded<T>

§

impl<T> !Send for Guarded<T>

§

impl<T> !Sync for Guarded<T>

§

impl<T> Unpin for Guarded<T>where T: Unpin,

§

impl<T> !UnwindSafe for Guarded<T>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.