Struct mysql_common::binlog::events::GtidEvent
source · pub struct GtidEvent { /* private fields */ }
Expand description
GTID stands for Global Transaction IDentifier.
Implementations§
source§impl GtidEvent
impl GtidEvent
pub const POST_HEADER_LENGTH: usize = 42usize
pub const ENCODED_SID_LENGTH: usize = 16usize
pub const LOGICAL_TIMESTAMP_TYPECODE: u8 = 2u8
pub const IMMEDIATE_COMMIT_TIMESTAMP_LENGTH: usize = 7usize
pub const ORIGINAL_COMMIT_TIMESTAMP_LENGTH: usize = 7usize
pub const UNDEFINED_SERVER_VERSION: u32 = 999_999u32
pub const IMMEDIATE_SERVER_VERSION_LENGTH: usize = 4usize
pub fn new(sid: [u8; 16], gno: u64) -> Self
sourcepub fn with_flags(self, flags: GtidFlags) -> Self
pub fn with_flags(self, flags: GtidFlags) -> Self
Defines the flags
value.
sourcepub fn flags(&self) -> GtidFlags
pub fn flags(&self) -> GtidFlags
Returns the flags
value. Unknown bits will be truncated.
00000001
– Transaction may have changes logged with SBR.
In 5.6, 5.7.0-5.7.18, and 8.0.0-8.0.1, this flag is always set. Starting in 5.7.19 and 8.0.2, this flag is cleared if the transaction only contains row events. It is set if any part of the transaction is written in statement format.
sourcepub fn gno(&self) -> u64
pub fn gno(&self) -> u64
Returns the gno
value.
gno
is a group number, second component of GTID.
sourcepub fn lc_typecode(&self) -> Option<u8>
pub fn lc_typecode(&self) -> Option<u8>
Returns the lc_typecode
value.
lc_typecode
is the type of logical timestamp used in the logical clock fields.
sourcepub fn with_lc_typecode(self) -> Self
pub fn with_lc_typecode(self) -> Self
Sets the lc_typecode
value to GtidEvent::LOGICAL_TIMESTAMP_TYPECODE
.
This is already by default, but lc_typecode
might be None
if Self
is obtained
from an old MySql server via MyDeserialize::deserialize
.
sourcepub fn with_last_committed(self, last_committed: u64) -> Self
pub fn with_last_committed(self, last_committed: u64) -> Self
Sets the last_committed
value.
sourcepub fn last_committed(&self) -> u64
pub fn last_committed(&self) -> u64
Returns the last_committed
value.
last_committed
stores the transaction’s commit parent sequence_number
.
sourcepub fn with_sequence_number(self, sequence_number: u64) -> Self
pub fn with_sequence_number(self, sequence_number: u64) -> Self
Sets the sequence_number
value.
sourcepub fn sequence_number(&self) -> u64
pub fn sequence_number(&self) -> u64
Returns the sequence_number
value.
sequence_number
is the transaction’s logical timestamp assigned at prepare phase.
sourcepub fn with_immediate_commit_timestamp(
self,
immediate_commit_timestamp: u64,
) -> Self
pub fn with_immediate_commit_timestamp( self, immediate_commit_timestamp: u64, ) -> Self
Sets the immediate_commit_timestamp
value.
sourcepub fn immediate_commit_timestamp(&self) -> u64
pub fn immediate_commit_timestamp(&self) -> u64
Returns the immediate_commit_timestamp
value.
immediate_commit_timestamp
is a timestamp of commit on the immediate master.
sourcepub fn with_original_commit_timestamp(
self,
original_commit_timestamp: u64,
) -> Self
pub fn with_original_commit_timestamp( self, original_commit_timestamp: u64, ) -> Self
Sets the original_commit_timestamp
value.
sourcepub fn original_commit_timestamp(&self) -> u64
pub fn original_commit_timestamp(&self) -> u64
Returns the original_commit_timestamp
value.
original_commit_timestamp
is the timestamp of commit on the originating master.
sourcepub fn with_tx_length(self, tx_length: u64) -> Self
pub fn with_tx_length(self, tx_length: u64) -> Self
Sets the tx_length
value.
sourcepub fn tx_length(&self) -> u64
pub fn tx_length(&self) -> u64
Returns the tx_length
value.
tx_length
is the packed transaction’s length in bytes, including the Gtid.
sourcepub fn with_original_server_version(self, original_server_version: u32) -> Self
pub fn with_original_server_version(self, original_server_version: u32) -> Self
Sets the original_server_version
value.
sourcepub fn original_server_version(&self) -> u32
pub fn original_server_version(&self) -> u32
Returns the original_server_version
value.
original_server_version
is the version of the server where the transaction was originally
executed.
sourcepub fn with_immediate_server_version(
self,
immediate_server_version: u32,
) -> Self
pub fn with_immediate_server_version( self, immediate_server_version: u32, ) -> Self
Sets the immediate_server_version
value.
sourcepub fn immediate_server_version(&self) -> u32
pub fn immediate_server_version(&self) -> u32
Returns the immediate_server_version
value.
immediate_server_version
is the server version of the immediate server.
Trait Implementations§
source§impl<'a> BinlogEvent<'a> for GtidEvent
impl<'a> BinlogEvent<'a> for GtidEvent
source§const EVENT_TYPE: EventType = EventType::GTID_EVENT
const EVENT_TYPE: EventType = EventType::GTID_EVENT
source§impl<'a> BinlogStruct<'a> for GtidEvent
impl<'a> BinlogStruct<'a> for GtidEvent
source§impl<'de> MyDeserialize<'de> for GtidEvent
impl<'de> MyDeserialize<'de> for GtidEvent
source§impl MySerialize for GtidEvent
impl MySerialize for GtidEvent
impl Eq for GtidEvent
impl StructuralPartialEq for GtidEvent
Auto Trait Implementations§
impl Freeze for GtidEvent
impl RefUnwindSafe for GtidEvent
impl Send for GtidEvent
impl Sync for GtidEvent
impl Unpin for GtidEvent
impl UnwindSafe for GtidEvent
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.