[][src]Struct ainoio_agent::Transaction

pub struct Transaction {
    pub from: String,
    pub to: String,
    pub status: Status,
    pub timestamp: u128,
    pub operation: String,
    pub flow_id: String,
    pub payload_type: Option<String>,
    pub message: Option<String>,
    pub ids: Option<Vec<TransactionId>>,
    pub metadata: Option<Vec<TransactionMetadata>>,
}

A log entry for a single Transaction between two applications.

Fields

from: String

The name of originating application

to: String

The name of the target application

status: Status

A Status flag indicating the whether the Transaction was successful or not.

timestamp: u128

The timestamp when the Transaction took place, in milliseconds.

operation: String

The operation of the Transaction.

flow_id: String

The ID for the whole logical flow if Transactions.

payload_type: Option<String>

The type of payload in the Transaction (optional)

message: Option<String>

A possible log message (optional)

ids: Option<Vec<TransactionId>>

All IDs related to this Transaction (optional)

metadata: Option<Vec<TransactionMetadata>>

All metadata related to this Transaction (optional)

Methods

impl Transaction[src]

pub fn new(
    from: String,
    to: String,
    operation: String,
    status: Status,
    timestamp: u128,
    flow_id: String
) -> Self
[src]

Constructs a single Transaction with the mandatory values.

pub fn add_metadata(&mut self, metadata: TransactionMetadata) -> &mut Self[src]

Adds a metadata to the Transaction

pub fn add_id(&mut self, id: TransactionId) -> &mut Self[src]

Add an ID to the Transaction

Trait Implementations

impl Clone for Transaction[src]

impl Debug for Transaction[src]

impl Display for Transaction[src]

impl Serialize for Transaction[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.