pub struct BinlogEventHeader {
pub timestamp: u32,
pub type_code: u8,
pub server_id: u32,
pub event_length: u32,
pub next_position: u32,
pub flags: u16,
}Expand description
Parsed binlog event header (19 bytes, common to all events).
§Examples
use idb::binlog::header::BinlogEventHeader;
use byteorder::{LittleEndian, ByteOrder};
let mut buf = vec![0u8; 19];
LittleEndian::write_u32(&mut buf[0..], 1700000000); // timestamp
buf[4] = 15; // FORMAT_DESCRIPTION_EVENT
LittleEndian::write_u32(&mut buf[5..], 1); // server_id
LittleEndian::write_u32(&mut buf[9..], 100); // event_length
LittleEndian::write_u32(&mut buf[13..], 119); // next_position
LittleEndian::write_u16(&mut buf[17..], 0); // flags
let hdr = BinlogEventHeader::parse(&buf).unwrap();
assert_eq!(hdr.timestamp, 1700000000);
assert_eq!(hdr.type_code, 15);
assert_eq!(hdr.server_id, 1);
assert_eq!(hdr.event_length, 100);
assert_eq!(hdr.next_position, 119);Fields§
§timestamp: u32Unix timestamp of the event.
type_code: u8Event type code.
server_id: u32Server ID that produced the event.
event_length: u32Total length of the event (header + data + checksum).
next_position: u32Position of the next event in the binlog file.
flags: u16Event flags.
Implementations§
Trait Implementations§
Source§impl Clone for BinlogEventHeader
impl Clone for BinlogEventHeader
Source§fn clone(&self) -> BinlogEventHeader
fn clone(&self) -> BinlogEventHeader
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 BinlogEventHeader
impl Debug for BinlogEventHeader
Auto Trait Implementations§
impl Freeze for BinlogEventHeader
impl RefUnwindSafe for BinlogEventHeader
impl Send for BinlogEventHeader
impl Sync for BinlogEventHeader
impl Unpin for BinlogEventHeader
impl UnsafeUnpin for BinlogEventHeader
impl UnwindSafe for BinlogEventHeader
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