pub struct MutexPool { /* private fields */ }Implementations§
Source§impl MutexPool
impl MutexPool
Sourcepub fn create_mutex(&mut self) -> usize
pub fn create_mutex(&mut self) -> usize
Creates a mutex, returning its ID.
Sourcepub fn delete_mutex(&mut self, mutex_id: usize)
pub fn delete_mutex(&mut self, mutex_id: usize)
Creates a mutex, returning its ID.
Sourcepub async fn lock(&mut self, mutex_id: usize, timeout: Option<Instant>) -> bool
pub async fn lock(&mut self, mutex_id: usize, timeout: Option<Instant>) -> bool
Locks a mutex by ID, cancelling on timeout, and returning a boolean of whether the lock was successful.
pub fn unlock(&mut self, mutex_id: usize)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MutexPool
impl !RefUnwindSafe for MutexPool
impl Send for MutexPool
impl Sync for MutexPool
impl Unpin for MutexPool
impl UnsafeUnpin for MutexPool
impl !UnwindSafe for MutexPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more