pub struct BinlogRequest<'a> { /* private fields */ }
Expand description
Binlog request representation. Please consult MySql documentation.
This struct is a helper builder for ComBinlogDump
and ComBinlogDumpGtid
.
Implementations§
Source§impl<'a> BinlogRequest<'a>
impl<'a> BinlogRequest<'a>
Sourcepub fn new(server_id: u32) -> BinlogRequest<'a>
pub fn new(server_id: u32) -> BinlogRequest<'a>
Creates new request with the given slave server id.
Sourcepub fn use_gtid(&self) -> bool
pub fn use_gtid(&self) -> bool
If true, then COM_BINLOG_DUMP_GTID
will be used (defaults to false
).
Sourcepub fn flags(&self) -> BinlogDumpFlags
pub fn flags(&self) -> BinlogDumpFlags
If use_gtid
is false
, then all flags except BINLOG_DUMP_NON_BLOCK
will be truncated
(defaults to empty).
Sourcepub fn filename_raw(&'a self) -> &'a [u8] ⓘ
pub fn filename_raw(&'a self) -> &'a [u8] ⓘ
Filename of the binlog on the master (defaults to an empty string).
Sourcepub fn filename(&'a self) -> &'a [u8] ⓘ
pub fn filename(&'a self) -> &'a [u8] ⓘ
Filename of the binlog on the master as a UTF-8 string (lossy converted) (defaults to an empty string).
Sourcepub fn pos(&self) -> u64
pub fn pos(&self) -> u64
Position in the binlog-file to start the stream with (defaults to 4
).
If use_gtid
is false
, then the value will be truncated to u32.
Sourcepub fn sids(&self) -> &[Sid<'_>]
pub fn sids(&self) -> &[Sid<'_>]
If use_gtid
is false
, then this value will be ignored (defaults to an empty vector).
Sourcepub fn with_server_id(self, server_id: u32) -> BinlogRequest<'a>
pub fn with_server_id(self, server_id: u32) -> BinlogRequest<'a>
Returns modified self
with the given value of the server_id
field.
Sourcepub fn with_use_gtid(self, use_gtid: bool) -> BinlogRequest<'a>
pub fn with_use_gtid(self, use_gtid: bool) -> BinlogRequest<'a>
Returns modified self
with the given value of the use_gtid
field.
Sourcepub fn with_flags(self, flags: BinlogDumpFlags) -> BinlogRequest<'a>
pub fn with_flags(self, flags: BinlogDumpFlags) -> BinlogRequest<'a>
Returns modified self
with the given value of the flags
field.
Sourcepub fn with_filename(
self,
filename: impl Into<Cow<'a, [u8]>>,
) -> BinlogRequest<'a>
pub fn with_filename( self, filename: impl Into<Cow<'a, [u8]>>, ) -> BinlogRequest<'a>
Returns modified self
with the given value of the filename
field.
Sourcepub fn with_pos<T>(self, pos: T) -> BinlogRequest<'a>
pub fn with_pos<T>(self, pos: T) -> BinlogRequest<'a>
Returns modified self
with the given value of the pos
field.
Sourcepub fn with_sids<T>(self, sids: T) -> BinlogRequest<'a>where
T: IntoIterator<Item = Sid<'a>>,
pub fn with_sids<T>(self, sids: T) -> BinlogRequest<'a>where
T: IntoIterator<Item = Sid<'a>>,
Returns modified self
with the given value of the sid_blocks
field.
pub fn as_cmd(&self) -> Either<ComBinlogDump<'_>, ComBinlogDumpGtid<'_>>
Trait Implementations§
Source§impl<'a> Clone for BinlogRequest<'a>
impl<'a> Clone for BinlogRequest<'a>
Source§fn clone(&self) -> BinlogRequest<'a>
fn clone(&self) -> BinlogRequest<'a>
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more