pub struct FormatDescriptionEvent {
pub binlog_version: u16,
pub server_version: String,
pub create_timestamp: u32,
pub header_length: u8,
pub checksum_alg: u8,
}Expand description
Parsed Format Description Event (type 15).
The first real event in any v4 binlog file. Describes the binlog format version, server version string, creation timestamp, and event header length.
§Examples
use idb::binlog::header::FormatDescriptionEvent;
use byteorder::{LittleEndian, ByteOrder};
let mut buf = vec![0u8; 100];
// binlog_version = 4
LittleEndian::write_u16(&mut buf[0..], 4);
// server_version (50 bytes, null-padded)
let ver = b"8.0.35";
buf[2..2 + ver.len()].copy_from_slice(ver);
// create_timestamp
LittleEndian::write_u32(&mut buf[52..], 1700000000);
// header_length
buf[56] = 19;
let fde = FormatDescriptionEvent::parse(&buf).unwrap();
assert_eq!(fde.binlog_version, 4);
assert_eq!(fde.server_version, "8.0.35");
assert_eq!(fde.create_timestamp, 1700000000);
assert_eq!(fde.header_length, 19);Fields§
§binlog_version: u16Binlog format version (always 4 for MySQL 5.0+).
server_version: StringServer version string (e.g. “8.0.35”).
create_timestamp: u32Timestamp when the binlog was created.
header_length: u8Length of each event header (19 for v4).
checksum_alg: u8Checksum algorithm (0 = none, 1 = CRC32).
Implementations§
Trait Implementations§
Source§impl Clone for FormatDescriptionEvent
impl Clone for FormatDescriptionEvent
Source§fn clone(&self) -> FormatDescriptionEvent
fn clone(&self) -> FormatDescriptionEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FormatDescriptionEvent
impl Debug for FormatDescriptionEvent
Auto Trait Implementations§
impl Freeze for FormatDescriptionEvent
impl RefUnwindSafe for FormatDescriptionEvent
impl Send for FormatDescriptionEvent
impl Sync for FormatDescriptionEvent
impl Unpin for FormatDescriptionEvent
impl UnsafeUnpin for FormatDescriptionEvent
impl UnwindSafe for FormatDescriptionEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more