Struct BinlogRequest

Source
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>

Source

pub fn new(server_id: u32) -> BinlogRequest<'a>

Creates new request with the given slave server id.

Source

pub fn server_id(&self) -> u32

Server id of a slave.

Source

pub fn use_gtid(&self) -> bool

If true, then COM_BINLOG_DUMP_GTID will be used (defaults to false).

Source

pub fn flags(&self) -> BinlogDumpFlags

If use_gtid is false, then all flags except BINLOG_DUMP_NON_BLOCK will be truncated (defaults to empty).

Source

pub fn filename_raw(&'a self) -> &'a [u8]

Filename of the binlog on the master (defaults to an empty string).

Source

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).

Source

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.

Source

pub fn sids(&self) -> &[Sid<'_>]

If use_gtid is false, then this value will be ignored (defaults to an empty vector).

Source

pub fn with_server_id(self, server_id: u32) -> BinlogRequest<'a>

Returns modified self with the given value of the server_id field.

Source

pub fn with_use_gtid(self, use_gtid: bool) -> BinlogRequest<'a>

Returns modified self with the given value of the use_gtid field.

Source

pub fn with_flags(self, flags: BinlogDumpFlags) -> BinlogRequest<'a>

Returns modified self with the given value of the flags field.

Source

pub fn with_filename( self, filename: impl Into<Cow<'a, [u8]>>, ) -> BinlogRequest<'a>

Returns modified self with the given value of the filename field.

Source

pub fn with_pos<T>(self, pos: T) -> BinlogRequest<'a>
where T: Into<u64>,

Returns modified self with the given value of the pos field.

Source

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.

Source

pub fn as_cmd(&self) -> Either<ComBinlogDump<'_>, ComBinlogDumpGtid<'_>>

Trait Implementations§

Source§

impl<'a> Clone for BinlogRequest<'a>

Source§

fn clone(&self) -> BinlogRequest<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for BinlogRequest<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a> Hash for BinlogRequest<'a>

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a> PartialEq for BinlogRequest<'a>

Source§

fn eq(&self, other: &BinlogRequest<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Eq for BinlogRequest<'a>

Source§

impl<'a> StructuralPartialEq for BinlogRequest<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for BinlogRequest<'a>

§

impl<'a> RefUnwindSafe for BinlogRequest<'a>

§

impl<'a> Send for BinlogRequest<'a>

§

impl<'a> Sync for BinlogRequest<'a>

§

impl<'a> Unpin for BinlogRequest<'a>

§

impl<'a> UnwindSafe for BinlogRequest<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,