Struct pravega_client::event::Transaction
source · pub struct Transaction { /* private fields */ }
Expand description
Pravega Transaction support.
It can be used to write, commit and abort a Pravega Transaction.
Implementations§
source§impl Transaction
impl Transaction
sourcepub async fn write_event(
&mut self,
routing_key: Option<String>,
event: Vec<u8>
) -> Result<(), TransactionError>
pub async fn write_event( &mut self, routing_key: Option<String>, event: Vec<u8> ) -> Result<(), TransactionError>
write_event accepts a vec of bytes as the input event and an optional routing key which is used to determine which segment to write to. It calls the corresponding transactional event segment writer to write the data to the server.
sourcepub async fn commit(
&mut self,
timestamp: Timestamp
) -> Result<(), TransactionError>
pub async fn commit( &mut self, timestamp: Timestamp ) -> Result<(), TransactionError>
commit accepts a timestamp and will send a commit request to Pravega controller.
sourcepub async fn abort(&mut self) -> Result<(), TransactionError>
pub async fn abort(&mut self) -> Result<(), TransactionError>
abort will send abort request to Pravega controller.
sourcepub async fn check_status(&self) -> Result<TransactionStatus, TransactionError>
pub async fn check_status(&self) -> Result<TransactionStatus, TransactionError>
check the current Transaction status by sending request to Pravega controller.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Transaction
impl !RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl !UnwindSafe for Transaction
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request