Struct MYSQL_PLUGIN_VIO

Source
#[repr(C)]
pub struct MYSQL_PLUGIN_VIO { pub read_packet: Option<unsafe extern "C" fn(vio: *mut MYSQL_PLUGIN_VIO, buf: *mut *mut c_uchar) -> c_int>, pub write_packet: Option<unsafe extern "C" fn(vio: *mut MYSQL_PLUGIN_VIO, packet: *const c_uchar, packet_len: c_int) -> c_int>, pub info: Option<unsafe extern "C" fn(vio: *mut MYSQL_PLUGIN_VIO, info: *mut MYSQL_PLUGIN_VIO_INFO)>, pub read_packet_nonblocking: Option<unsafe extern "C" fn(vio: *mut MYSQL_PLUGIN_VIO, buf: *mut *mut c_uchar, result: *mut c_int) -> net_async_status>, pub write_packet_nonblocking: Option<unsafe extern "C" fn(vio: *mut MYSQL_PLUGIN_VIO, pkt: *const c_uchar, pkt_len: c_int, result: *mut c_int) -> net_async_status>, }
Expand description

Provides plugin access to communication channel

Fields§

§read_packet: Option<unsafe extern "C" fn(vio: *mut MYSQL_PLUGIN_VIO, buf: *mut *mut c_uchar) -> c_int>

Plugin provides a pointer reference and this function sets it to the contents of any incoming packet. Returns the packet length, or -1 if the plugin should terminate.

§write_packet: Option<unsafe extern "C" fn(vio: *mut MYSQL_PLUGIN_VIO, packet: *const c_uchar, packet_len: c_int) -> c_int>

Plugin provides a buffer with data and the length and this function sends it as a packet. Returns 0 on success, 1 on failure.

§info: Option<unsafe extern "C" fn(vio: *mut MYSQL_PLUGIN_VIO, info: *mut MYSQL_PLUGIN_VIO_INFO)>

Fills in a MYSQL_PLUGIN_VIO_INFO structure, providing the information about the connection.

§read_packet_nonblocking: Option<unsafe extern "C" fn(vio: *mut MYSQL_PLUGIN_VIO, buf: *mut *mut c_uchar, result: *mut c_int) -> net_async_status>

Non blocking version of read_packet. This function points buf to starting position of incoming packet. When this function returns NET_ASYNC_NOT_READY plugin should call this function again until all incoming packets are read. If return code is NET_ASYNC_COMPLETE, plugin can do further processing of read packets.

§write_packet_nonblocking: Option<unsafe extern "C" fn(vio: *mut MYSQL_PLUGIN_VIO, pkt: *const c_uchar, pkt_len: c_int, result: *mut c_int) -> net_async_status>

Non blocking version of write_packet. Sends data available in pkt of length pkt_len to server in asynchronous way.

Trait Implementations§

Source§

impl Clone for MYSQL_PLUGIN_VIO

Source§

fn clone(&self) -> MYSQL_PLUGIN_VIO

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for MYSQL_PLUGIN_VIO

Source§

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

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

impl Copy for MYSQL_PLUGIN_VIO

Auto Trait Implementations§

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