#[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
impl Clone for MYSQL_PLUGIN_VIO
Source§fn clone(&self) -> MYSQL_PLUGIN_VIO
fn clone(&self) -> MYSQL_PLUGIN_VIO
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more