futures_intrusive::sync

Struct GenericSharedSemaphoreReleaser

Source
pub struct GenericSharedSemaphoreReleaser<MutexType: RawMutex> { /* private fields */ }
Expand description

An RAII guard returned by the acquire and try_acquire methods.

When this structure is dropped (falls out of scope), the amount of permits that was used in the acquire() call will be released back to the Semaphore.

Implementations§

Source§

impl<MutexType: RawMutex> GenericSharedSemaphoreReleaser<MutexType>

Source

pub fn disarm(&mut self) -> usize

Prevents the SharedSemaphoreReleaser from automatically releasing the permits when it gets dropped.

This is helpful if the permits must be acquired for a longer lifetime than the one of the SemaphoreReleaser.

If this method is used it is important to release the acquired permits manually back to the Semaphore.

Trait Implementations§

Source§

impl<MutexType: RawMutex> Debug for GenericSharedSemaphoreReleaser<MutexType>

Source§

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

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

impl<MutexType: RawMutex> Drop for GenericSharedSemaphoreReleaser<MutexType>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<MutexType> Freeze for GenericSharedSemaphoreReleaser<MutexType>

§

impl<MutexType> !RefUnwindSafe for GenericSharedSemaphoreReleaser<MutexType>

§

impl<MutexType> Send for GenericSharedSemaphoreReleaser<MutexType>
where MutexType: Send + Sync,

§

impl<MutexType> Sync for GenericSharedSemaphoreReleaser<MutexType>
where MutexType: Sync,

§

impl<MutexType> Unpin for GenericSharedSemaphoreReleaser<MutexType>

§

impl<MutexType> !UnwindSafe for GenericSharedSemaphoreReleaser<MutexType>

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.