Skip to main content

Table

Struct Table 

Source
pub struct Table { /* private fields */ }
Expand description

Typed access to one table-backed Cobble column family.

Implementations§

Source§

impl Table

Source

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.

Source

pub fn open(db: Arc<Db>, name: impl Into<String>) -> Result<Self>

Open a table from metadata stored in its column-family options.

Source

pub fn schema(&self) -> &TableSchema

Return the persisted semantic schema of this table.

Source

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.

Source

pub fn key_builder(&self) -> TableKeyBuilder

Start building one primary key in schema order.

Source

pub fn project_by_names<S: AsRef<str>>( &self, field_names: &[S], ) -> Result<TableProjection>

Compile a reusable read projection from top-level field names.

Source

pub fn put(&self, row: &[Value]) -> Result<()>

Write one full row in schema field order.

Source

pub fn put_with_options( &self, row: &[Value], options: &WriteOptions, ) -> Result<()>

Write one full row with caller options safely rebound to this table.

Source

pub fn delete(&self, key: &TableKey) -> Result<()>

Delete one complete row.

Source

pub fn delete_batch(&self, keys: &[TableKey]) -> Result<()>

Delete complete rows in one batch without cloning encoded keys.

Source

pub fn get(&self, key: &TableKey) -> Result<Option<Vec<Value>>>

Read one row by primary key.

Source

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.

Source

pub fn scan(&self, bucket: u16) -> Result<TableScan>

Scan all rows in one bucket.

Source

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.

Source

pub fn snapshot(&self) -> Result<u64>

Start an asynchronous shard snapshot, returning its id immediately.

Source

pub fn snapshot_with_callback<F>(&self, callback: F) -> Result<u64>
where F: Fn(Result<ShardSnapshotMetadata>) + Send + Sync + 'static,

Receive either the completed shard input or its publication error.

Source

pub fn snapshot_and_wait(&self) -> Result<ShardSnapshotMetadata>

Create a snapshot and wait for its callback, without polling.

Source

pub fn shard_snapshot_metadata( &self, snapshot_id: u64, ) -> Result<ShardSnapshotMetadata>

Return complete metadata for a completed shard snapshot.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scope for T

Source§

fn with<F, R>(self, f: F) -> R
where Self: Sized, F: FnOnce(Self) -> R,

Scoped with ownership.
Source§

fn with_ref<F, R>(&self, f: F) -> R
where F: FnOnce(&Self) -> R,

Scoped with reference.
Source§

fn with_mut<F, R>(&mut self, f: F) -> R
where F: FnOnce(&mut Self) -> R,

Scoped with mutable reference.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnsafeAny for T
where T: Any,

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Value for T
where T: Send + Sync + 'static,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more