Skip to main content

DatabaseEventBuilder

Struct DatabaseEventBuilder 

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

Builder for constructing a single DatabaseEvent.

Implementations§

Source§

impl DatabaseEventBuilder

Source

pub fn new( operation: OperationType, schema: impl Into<String>, table: impl Into<String>, ) -> Self

Create a new builder for a DML operation.

Source

pub fn insert(schema: impl Into<String>, table: impl Into<String>) -> Self

Create a builder for an INSERT event.

Source

pub fn update(schema: impl Into<String>, table: impl Into<String>) -> Self

Create a builder for an UPDATE event.

Source

pub fn delete(schema: impl Into<String>, table: impl Into<String>) -> Self

Create a builder for a DELETE event.

Source

pub fn snapshot_row(schema: impl Into<String>, table: impl Into<String>) -> Self

Create a builder for a snapshot row.

Source

pub fn begin() -> Self

Create a builder for BEGIN transaction.

Source

pub fn commit() -> Self

Create a builder for COMMIT transaction.

Source

pub fn ddl(sql: impl Into<String>, object_type: impl Into<String>) -> Self

Create a builder for a DDL event.

Source

pub fn event_id(self, id: impl Into<String>) -> Self

Set the event ID.

Source

pub fn timestamp_us(self, ts: u64) -> Self

Set the timestamp in microseconds.

Source

pub fn timestamp(self, ts: SystemTime) -> Self

Set the timestamp from SystemTime.

Source

pub fn position(self, pos: u64) -> Self

Set the replication position (LSN).

Source

pub fn transaction_id(self, xid: u64) -> Self

Set the transaction ID.

Source

pub fn new_row(self, row: Row) -> Self

Set the new row data.

Source

pub fn old_row(self, row: Row) -> Self

Set the old row data.

Source

pub fn columns(self, columns: Vec<String>) -> Self

Set column names.

Source

pub fn relation_meta(self, meta: RelationMeta) -> Self

Set relation metadata.

Source

pub fn build(self) -> DatabaseEvent

Build the event.

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.