surrealcs_kernel::logging::messages::transactions::base

Enum TransactionJourney

source
pub enum TransactionJourney {
    SentByTransactionClient,
    RecievedByClientTransactionActor,
    RecievedByClientWriter,
    RecievedByServerReader,
    RecievedByServerRouter,
    RecievedByServerTransactionActor,
    RecievedByServerWriter,
    RecievedByClientReader,
    RecievedByClientRouter,
    RecievedByClientTransactionActorAgain,
    RecievedByTransactionClient,
}
Expand description

Represents the journey of a transaction message.

This enum represents the journey of a transaction message. It is used to log the journey of a transaction message

§Variants

  • SentByTransactionClient: The transaction message was sent by the transaction client
  • RecievedByClientTransactionActor: The transaction message was recieved by the client transaction actor
  • RecievedByClientWriter: The transaction message was recieved by the client writer
  • RecievedByServerReader: The transaction message was recieved by the server reader
  • RecievedByServerRouter: The transaction message was recieved by the server router
  • RecievedByServerTransactionActor: The transaction message was recieved by the server transaction actor
  • RecievedByServerWriter: The transaction message was recieved by the server writer
  • RecievedByClientReader: The transaction message was recieved by the client reader
  • RecievedByClientRouter: The transaction message was recieved by the client router
  • RecievedByClientTransactionActorAgain: The transaction message was recieved by the client transaction actor again
  • RecievedByTransactionClient: The transaction message was recieved by the transaction client

Variants§

§

SentByTransactionClient

§

RecievedByClientTransactionActor

§

RecievedByClientWriter

§

RecievedByServerReader

§

RecievedByServerRouter

§

RecievedByServerTransactionActor

§

RecievedByServerWriter

§

RecievedByClientReader

§

RecievedByClientRouter

§

RecievedByClientTransactionActorAgain

§

RecievedByTransactionClient

Implementations§

source§

impl TransactionJourney

source

pub fn as_str(&self) -> &'static str

Returns the string representation of the transaction journey.

§Returns

The string representation of the transaction journey

source

pub fn to_begin_log( &self, connection_id: &String, transaction_id: &Option<String>, data: &TransactionData, ) -> String

Returns the log message for the transaction journey when the transaction message is a begin transaction message.

§Arguments
  • connection_id: the id of the connection that the transaction message is associated with
  • transaction_id: the id of the transaction that the transaction message is associated with
  • data: the data of the transaction message such as the operation type and key value pairs
§Returns

The log message for the transaction journey when the transaction message is a begin transaction message

source

pub fn to_send_log( &self, connection_id: &String, transaction_id: &Option<String>, data: &TransactionData, ) -> String

Returns the log message for the transaction journey when the transaction message is a send operation message.

§Arguments
  • connection_id: the id of the connection that the transaction message is associated with
  • transaction_id: the id of the transaction that the transaction message is associated with
  • data: the data of the transaction message such as the operation type and key value pairs
§Returns

The log message for the transaction journey when the transaction message is a send operation message

source

pub fn to_ping_log( &self, connection_id: &String, transaction_id: &Option<String>, data: &TransactionData, ) -> String

Returns the log message for the transaction journey when the transaction message is a commit transaction message.

§Arguments
  • connection_id: the id of the connection that the transaction message is associated with
  • transaction_id: the id of the transaction that the transaction message is associated with
  • data: the data of the transaction message such as the operation type and key value pairs
§Returns

The log message for the transaction journey when the transaction message is a commit transaction message

source

pub fn to_error_log( &self, connection_id: &String, transaction_id: &Option<String>, data: &TransactionData, ) -> String

Returns the log message for the transaction journey when the transaction message is an error message.

§Arguments
  • connection_id: the id of the connection that the transaction message is associated with
  • transaction_id: the id of the transaction that the transaction message is associated with
  • data: the data of the transaction message such as the operation type and key value pairs
§Returns

The log message for the transaction journey when the transaction message is an error message

source

pub fn to_commit_log( &self, connection_id: &String, transaction_id: &Option<String>, ) -> String

Returns the log message for the transaction journey when the transaction message is an commit message.

§Arguments
  • connection_id: the id of the connection that the transaction message is associated with
  • transaction_id: the id of the transaction that the transaction message is associated with
§Returns

The log message for the transaction journey when the transaction message is an commit message

source

pub fn to_rollback_log( &self, connection_id: &String, transaction_id: &Option<String>, ) -> String

Returns the log message for the transaction journey when the transaction message is a rollback message.

§Arguments
  • connection_id: the id of the connection that the transaction message is associated with
  • transaction_id: the id of the transaction that the transaction message is associated with
§Returns

The log message for the transaction journey when the transaction message is a rollback message

source

pub fn from_wrapped_server_message( &self, message: &WrappedServerMessage, ) -> Option<String>

Returns the log message for the transaction journey when the transaction message is a rollback message.

§Arguments
  • message: the transaction message to be processed and unwrapped
§Returns

The log message for the transaction journey if the message is a transaction message

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> 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, 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.
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