Struct dist_tx::tm::XaTransactionId
[−]
[src]
pub struct XaTransactionId { /* fields omitted */ }
The ID of a distributed transaction, analogous to the X/Open XA standard.
Methods
impl XaTransactionId
[src]
fn new(
format_id: i32,
global_tid: Vec<u8>,
branch_qualifier: Vec<u8>
) -> XaResult<XaTransactionId>
[src]
format_id: i32,
global_tid: Vec<u8>,
branch_qualifier: Vec<u8>
) -> XaResult<XaTransactionId>
Creates an instance of XaTransactionId
from the three components format_id
,
global_tid
, and branch_qualifier
.
Note that the lengths of the binary parameters must not exceed 64
.
XA uses a signed int for the format_id, but recommends using only -1, 0, and positive values, where -1 is used to represent the NULL value.
fn null_ta() -> XaTransactionId
[src]
Creates an instance of XaTransactionId
that represents NULL.
fn get_format_id(&self) -> i32
[src]
Returns the format_id.
fn get_global_tid(&self) -> &Vec<u8>
[src]
Returns a reference to the global transaction id.
fn get_branch_qualifier(&self) -> &Vec<u8>
[src]
Returns a reference to the branch qualifier.
fn as_bytes(&self, padding: bool) -> Result<Vec<u8>>
[src]
Provides a binary representation. If padding is true, and the combined length of the binary fields is below 128 bytes, the missing number of zero bytes are appended to make the byte pattern compatible with the XA structure in C.
fn parse(
bytes: &[u8],
count: u64,
padding: bool
) -> XaResult<Vec<XaTransactionId>>
[src]
bytes: &[u8],
count: u64,
padding: bool
) -> XaResult<Vec<XaTransactionId>>
Reads a Vec of instances from a binary representation. If padding is true, and the combined length of the binary fields is below 128 bytes, the missing number of bytes are skipped to make the byte pattern compatible with the XA structure in C.
Trait Implementations
impl Clone for XaTransactionId
[src]
fn clone(&self) -> XaTransactionId
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more