pub struct UseWebLockOptions { /* private fields */ }
Expand description
Options for crate::use_web_lock_with_options
.
Implementations§
Source§impl UseWebLockOptions
impl UseWebLockOptions
Sourcepub fn mode(self, value: LockMode) -> Self
pub fn mode(self, value: LockMode) -> Self
The default mode is LockMode::Exclusive
, but LockMode::Shared
can be specified.
There can be only one Exclusive
holder of a lock, but multiple Shared
requests can be
granted at the same time. This can be used to implement the
readers-writer pattern.
Sourcepub fn if_available(self, value: bool) -> Self
pub fn if_available(self, value: bool) -> Self
If true
, the lock request will fail if the lock cannot be granted immediately without
waiting. The callback is invoked with null
. Defaults to false
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UseWebLockOptions
impl RefUnwindSafe for UseWebLockOptions
impl Send for UseWebLockOptions
impl Sync for UseWebLockOptions
impl Unpin for UseWebLockOptions
impl UnwindSafe for UseWebLockOptions
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