pub struct Table<S, IS, C, G> { /* private fields */ }
Expand description
A database table with support for multiple indices
Implementations§
source§impl<S, C, FE, G> Table<S, S::Index, C, G>
impl<S, C, FE, G> Table<S, S::Index, C, G>
sourcepub async fn contains(&self, key: &[S::Value]) -> Result<bool, Error>
pub async fn contains(&self, key: &[S::Value]) -> Result<bool, Error>
Return true
if the given key
is present in this Table
.
sourcepub async fn first(
&self,
range: Range<S::Id, S::Value>,
order: &[S::Id],
select: Option<&[S::Id]>
) -> Result<Option<Row<S::Value>>, Error>
pub async fn first( &self, range: Range<S::Id, S::Value>, order: &[S::Id], select: Option<&[S::Id]> ) -> Result<Option<Row<S::Value>>, Error>
Return the first row in the given range
using the given order
.
source§impl<S, C, FE, G> Table<S, S::Index, C, G>
impl<S, C, FE, G> Table<S, S::Index, C, G>
sourcepub async fn count(&self, range: Range<S::Id, S::Value>) -> Result<u64, Error>
pub async fn count(&self, range: Range<S::Id, S::Value>) -> Result<u64, Error>
Count how many rows in this Table
lie within the given range
.
source§impl<S, IS, C, FE> Table<S, IS, C, DirWriteGuardOwned<FE>>
impl<S, IS, C, FE> Table<S, IS, C, DirWriteGuardOwned<FE>>
sourcepub fn downgrade(self) -> Table<S, IS, C, Arc<DirReadGuardOwned<FE>>>
pub fn downgrade(self) -> Table<S, IS, C, Arc<DirReadGuardOwned<FE>>>
Downgrade this write lock to a read lock.
source§impl<S, C, FE> Table<S, S::Index, C, DirWriteGuardOwned<FE>>
impl<S, C, FE> Table<S, S::Index, C, DirWriteGuardOwned<FE>>
sourcepub async fn delete_row(&mut self, key: &[S::Value]) -> Result<bool, Error>
pub async fn delete_row(&mut self, key: &[S::Value]) -> Result<bool, Error>
Delete a row from this Table
by its key
.
Returns true
if the given key
was present.
sourcepub async fn delete_range(
&mut self,
range: Range<S::Id, S::Value>
) -> Result<usize, Error>
pub async fn delete_range( &mut self, range: Range<S::Id, S::Value> ) -> Result<usize, Error>
Delete all rows in the given range
from this Table
.
sourcepub async fn delete_all(
&mut self,
other: TableReadGuard<S, S::Index, C, FE>
) -> Result<(), Error>
pub async fn delete_all( &mut self, other: TableReadGuard<S, S::Index, C, FE> ) -> Result<(), Error>
Delete all rows from the other
table from this one.
The other
table must have an identical schema and collation.
sourcepub async fn merge(
&mut self,
other: TableReadGuard<S, S::Index, C, FE>
) -> Result<(), Error>
pub async fn merge( &mut self, other: TableReadGuard<S, S::Index, C, FE> ) -> Result<(), Error>
Insert all rows from the other
table into this one.
The other
table must have an identical schema and collation.
Trait Implementations§
Auto Trait Implementations§
impl<S, IS, C, G> RefUnwindSafe for Table<S, IS, C, G>
impl<S, IS, C, G> Send for Table<S, IS, C, G>
impl<S, IS, C, G> Sync for Table<S, IS, C, G>
impl<S, IS, C, G> Unpin for Table<S, IS, C, G>
impl<S, IS, C, G> UnwindSafe for Table<S, IS, C, G>
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
.