pub struct Table { /* private fields */ }Expand description
Typed access to one table-backed Cobble column family.
Implementations§
Source§impl Table
impl Table
Sourcepub fn create(
db: Arc<Db>,
name: impl Into<String>,
schema: TableSchema,
) -> Result<Self>
pub fn create( db: Arc<Db>, name: impl Into<String>, schema: TableSchema, ) -> Result<Self>
Create a table or reopen it when its persisted schema is identical.
Sourcepub fn open(db: Arc<Db>, name: impl Into<String>) -> Result<Self>
pub fn open(db: Arc<Db>, name: impl Into<String>) -> Result<Self>
Open a table from metadata stored in its column-family options.
Sourcepub fn schema(&self) -> &TableSchema
pub fn schema(&self) -> &TableSchema
Return the persisted semantic schema of this table.
Sourcepub fn metrics(&self) -> Vec<MetricSample>
pub fn metrics(&self) -> Vec<MetricSample>
Return metrics for this table’s backing database shard.
Metrics are collected at database scope and include all column families; they are not filtered to this table’s physical column family.
Sourcepub fn key_builder(&self) -> TableKeyBuilder
pub fn key_builder(&self) -> TableKeyBuilder
Start building one primary key in schema order.
Sourcepub fn project_by_names<S: AsRef<str>>(
&self,
field_names: &[S],
) -> Result<TableProjection>
pub fn project_by_names<S: AsRef<str>>( &self, field_names: &[S], ) -> Result<TableProjection>
Compile a reusable read projection from top-level field names.
Sourcepub fn put_with_options(
&self,
row: &[Value],
options: &WriteOptions,
) -> Result<()>
pub fn put_with_options( &self, row: &[Value], options: &WriteOptions, ) -> Result<()>
Write one full row with caller options safely rebound to this table.
Sourcepub fn delete_batch(&self, keys: &[TableKey]) -> Result<()>
pub fn delete_batch(&self, keys: &[TableKey]) -> Result<()>
Delete complete rows in one batch without cloning encoded keys.
Sourcepub fn multi_get(&self, keys: &[TableKey]) -> Result<Vec<Option<Vec<Value>>>>
pub fn multi_get(&self, keys: &[TableKey]) -> Result<Vec<Option<Vec<Value>>>>
Read many primary keys with one core multi-get, preserving order and duplicates.
Sourcepub fn scan_bounds(
&self,
bucket: u16,
start_key_inclusive: Option<&TableKey>,
end_key_exclusive: Option<&TableKey>,
) -> Result<TableScan>
pub fn scan_bounds( &self, bucket: u16, start_key_inclusive: Option<&TableKey>, end_key_exclusive: Option<&TableKey>, ) -> Result<TableScan>
Scan one bucket from an inclusive primary-key bound to an exclusive bound.
Sourcepub fn snapshot(&self) -> Result<u64>
pub fn snapshot(&self) -> Result<u64>
Start an asynchronous shard snapshot, returning its id immediately.
Sourcepub fn snapshot_with_callback<F>(&self, callback: F) -> Result<u64>
pub fn snapshot_with_callback<F>(&self, callback: F) -> Result<u64>
Receive either the completed shard input or its publication error.
Sourcepub fn snapshot_and_wait(&self) -> Result<ShardSnapshotMetadata>
pub fn snapshot_and_wait(&self) -> Result<ShardSnapshotMetadata>
Create a snapshot and wait for its callback, without polling.
Sourcepub fn shard_snapshot_metadata(
&self,
snapshot_id: u64,
) -> Result<ShardSnapshotMetadata>
pub fn shard_snapshot_metadata( &self, snapshot_id: u64, ) -> Result<ShardSnapshotMetadata>
Return complete metadata for a completed shard snapshot.
Sourcepub fn refresh_schema(&mut self) -> Result<bool>
pub fn refresh_schema(&mut self) -> Result<bool>
Refresh this writable handle from the local database schema.
This does not consult a catalog or track a moving catalog version. Existing projections remain bound to the layout they were compiled with and must be rebuilt after a change.
Auto Trait Implementations§
impl !RefUnwindSafe for Table
impl !UnwindSafe for Table
impl Freeze for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnsafeUnpin for Table
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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