pub struct InstanceEnv {
pub replica_ctx: Arc<ReplicaContext>,
pub scheduler: Scheduler,
pub tx: TxSlot,
pub start_time: Timestamp,
}Fields§
§replica_ctx: Arc<ReplicaContext>§scheduler: Scheduler§tx: TxSlot§start_time: TimestampThe timestamp the current reducer began running.
Implementations§
Source§impl InstanceEnv
impl InstanceEnv
pub fn new(replica_ctx: Arc<ReplicaContext>, scheduler: Scheduler) -> Self
Sourcepub fn start_reducer(&mut self, ts: Timestamp)
pub fn start_reducer(&mut self, ts: Timestamp)
Signal to this InstanceEnv that a reducer call is beginning.
pub fn console_log( &self, level: LogLevel, record: &Record<'_>, bt: &dyn BacktraceProvider, )
pub fn insert( &self, table_id: TableId, buffer: &mut [u8], ) -> Result<usize, NodesError>
pub fn update( &self, table_id: TableId, index_id: IndexId, buffer: &mut [u8], ) -> Result<usize, NodesError>
pub fn datastore_delete_by_index_scan_range_bsatn( &self, index_id: IndexId, prefix: &[u8], prefix_elems: ColId, rstart: &[u8], rend: &[u8], ) -> Result<u32, NodesError>
Sourcepub fn datastore_delete_all_by_eq_bsatn(
&self,
table_id: TableId,
relation: &[u8],
) -> Result<u32, NodesError>
pub fn datastore_delete_all_by_eq_bsatn( &self, table_id: TableId, relation: &[u8], ) -> Result<u32, NodesError>
Deletes all rows in the table identified by table_id
where the rows match one in relation
which is a bsatn encoding of Vec<ProductValue>.
Returns an error if
- not in a transaction.
- the table didn’t exist.
- a row couldn’t be decoded to the table schema type.
Sourcepub fn table_id_from_name(
&self,
table_name: &str,
) -> Result<TableId, NodesError>
pub fn table_id_from_name( &self, table_name: &str, ) -> Result<TableId, NodesError>
Returns the table_id associated with the given table_name.
Errors with GetTxError if not in a transaction
and TableNotFound if the table does not exist.
Sourcepub fn index_id_from_name(
&self,
index_name: &str,
) -> Result<IndexId, NodesError>
pub fn index_id_from_name( &self, index_name: &str, ) -> Result<IndexId, NodesError>
Returns the index_id associated with the given index_name.
Errors with GetTxError if not in a transaction
and IndexNotFound if the index does not exist.
Sourcepub fn datastore_table_row_count(
&self,
table_id: TableId,
) -> Result<u64, NodesError>
pub fn datastore_table_row_count( &self, table_id: TableId, ) -> Result<u64, NodesError>
Returns the number of rows in the table identified by table_id.
Errors with GetTxError if not in a transaction
and TableNotFound if the table does not exist.
pub fn datastore_table_scan_bsatn_chunks( &self, pool: &mut ChunkPool, table_id: TableId, ) -> Result<Vec<Vec<u8>>, NodesError>
pub fn datastore_index_scan_range_bsatn_chunks( &self, pool: &mut ChunkPool, index_id: IndexId, prefix: &[u8], prefix_elems: ColId, rstart: &[u8], rend: &[u8], ) -> Result<Vec<Vec<u8>>, NodesError>
Trait Implementations§
Source§impl Clone for InstanceEnv
impl Clone for InstanceEnv
Source§fn clone(&self) -> InstanceEnv
fn clone(&self) -> InstanceEnv
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InstanceEnv
impl !RefUnwindSafe for InstanceEnv
impl Send for InstanceEnv
impl Sync for InstanceEnv
impl Unpin for InstanceEnv
impl !UnwindSafe for InstanceEnv
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<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>
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 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>
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