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>where
S: Schema,
FE: AsType<Node<Vec<Vec<S::Value>>>> + Send + Sync,
Node<Vec<Vec<S::Value>>>: FileLoad,
impl<S, C, FE> BTreeLock<S, C, FE>where S: Schema, FE: AsType<Node<Vec<Vec<S::Value>>>> + Send + Sync, Node<Vec<Vec<S::Value>>>: FileLoad,
source§impl<S, C, FE> BTreeLock<S, C, FE>where
C: Clone,
FE: Send + Sync,
impl<S, C, FE> BTreeLock<S, C, FE>where C: Clone, FE: Send + Sync,
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> !RefUnwindSafe for BTreeLock<S, C, FE>
impl<S, C, FE> Send for BTreeLock<S, C, FE>where C: Send, FE: Send + Sync, S: Send + Sync,
impl<S, C, FE> Sync for BTreeLock<S, C, FE>where C: Sync, FE: Send + Sync, S: Send + Sync,
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<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
.