pub struct BTreeLock<S, C, FE> { /* private fields */ }
Expand description
A futures-aware read-write lock on a BTree
Implementations§
Source§impl<S, C, FE> BTreeLock<S, C, FE>
impl<S, C, FE> BTreeLock<S, C, FE>
Source§impl<S, C, FE> BTreeLock<S, C, FE>
impl<S, C, FE> BTreeLock<S, C, FE>
Sourcepub async fn into_read(self) -> BTreeReadGuard<S, C, FE>
pub async fn into_read(self) -> BTreeReadGuard<S, C, FE>
Lock this B+Tree for reading, without borrowing.
Sourcepub async fn read(&self) -> BTreeReadGuard<S, C, FE>
pub async fn read(&self) -> BTreeReadGuard<S, C, FE>
Lock this B+Tree for reading.
Sourcepub fn try_read(&self) -> Result<BTreeReadGuard<S, C, FE>, Error>
pub fn try_read(&self) -> Result<BTreeReadGuard<S, C, FE>, Error>
Lock this B+Tree for reading synchronously, if possible.
Sourcepub async fn into_write(self) -> BTreeWriteGuard<S, C, FE>
pub async fn into_write(self) -> BTreeWriteGuard<S, C, FE>
Lock this B+Tree for writing, without borrowing.
Sourcepub async fn write(&self) -> BTreeWriteGuard<S, C, FE>
pub async fn write(&self) -> BTreeWriteGuard<S, C, FE>
Lock this B+Tree for writing.
Sourcepub fn try_write(&self) -> Result<BTreeWriteGuard<S, C, FE>, Error>
pub fn try_write(&self) -> Result<BTreeWriteGuard<S, C, FE>, Error>
Lock this B+Tree for writing synchronously, if possible.
Trait Implementations§
Auto Trait Implementations§
impl<S, C, FE> Freeze for BTreeLock<S, C, FE>where
C: Freeze,
impl<S, C, FE> !RefUnwindSafe for BTreeLock<S, C, FE>
impl<S, C, FE> Send for BTreeLock<S, C, FE>
impl<S, C, FE> Sync for BTreeLock<S, C, FE>
impl<S, C, FE> Unpin for BTreeLock<S, C, FE>where
C: Unpin,
impl<S, C, FE> !UnwindSafe for BTreeLock<S, C, FE>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F> Match for F
impl<F> Match for F
Source§fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
Returns
true
if self
can be cast into the target type T
.Source§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
Source§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
Test if
value
can be cast into Self
.Source§fn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns
Some(Self)
if the source value can be cast into Self
, otherwise None
.Source§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
Source§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if
self
can be cast into T
.Source§fn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns
Some(T)
if self
can be cast into T
, otherwise None
.Source§fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
Returns
Ok(T)
if self
can be cast into T
, otherwise calls on_err
.