pub struct HandshakePacket<'a> { /* private fields */ }Expand description
Represents MySql’s initial handshake packet.
Implementations§
Source§impl<'a> HandshakePacket<'a>
impl<'a> HandshakePacket<'a>
pub fn new( protocol_version: u8, server_version: impl Into<Cow<'a, [u8]>>, connection_id: u32, scramble_1: [u8; 8], scramble_2: Option<impl Into<Cow<'a, [u8]>>>, capabilities: CapabilityFlags, default_collation: u8, status_flags: StatusFlags, auth_plugin_name: Option<impl Into<Cow<'a, [u8]>>>, ) -> Self
pub fn with_mariadb_ext_capabilities(self, flags: MariadbCapabilities) -> Self
pub fn into_owned(self) -> HandshakePacket<'static>
Sourcepub fn protocol_version(&self) -> u8
pub fn protocol_version(&self) -> u8
Value of the protocol_version field of an initial handshake packet.
Sourcepub fn server_version_ref(&self) -> &[u8] ⓘ
pub fn server_version_ref(&self) -> &[u8] ⓘ
Value of the server_version field of an initial handshake packet as a byte slice.
Sourcepub fn server_version_str(&self) -> Cow<'_, str>
pub fn server_version_str(&self) -> Cow<'_, str>
Value of the server_version field of an initial handshake packet as a string (lossy converted).
Sourcepub fn server_version_parsed(&self) -> Option<(u16, u16, u16)>
pub fn server_version_parsed(&self) -> Option<(u16, u16, u16)>
Parsed server version.
Will parse first \d+.\d+.\d+ of a server version string (if any).
Sourcepub fn maria_db_server_version_parsed(&self) -> Option<(u16, u16, u16)>
pub fn maria_db_server_version_parsed(&self) -> Option<(u16, u16, u16)>
Parsed mariadb server version.
Sourcepub fn connection_id(&self) -> u32
pub fn connection_id(&self) -> u32
Value of the connection_id field of an initial handshake packet.
Sourcepub fn scramble_1_ref(&self) -> &[u8] ⓘ
pub fn scramble_1_ref(&self) -> &[u8] ⓘ
Value of the scramble_1 field of an initial handshake packet as a byte slice.
Sourcepub fn scramble_2_ref(&self) -> Option<&[u8]>
pub fn scramble_2_ref(&self) -> Option<&[u8]>
Value of the scramble_2 field of an initial handshake packet as a byte slice.
Note that this may include a terminating null character.
Sourcepub fn capabilities(&self) -> CapabilityFlags
pub fn capabilities(&self) -> CapabilityFlags
Value of a server capabilities.
Sourcepub fn mariadb_ext_capabilities(&self) -> MariadbCapabilities
pub fn mariadb_ext_capabilities(&self) -> MariadbCapabilities
Value of MariaDB specific server capabilities
Sourcepub fn default_collation(&self) -> u8
pub fn default_collation(&self) -> u8
Value of the default_collation field of an initial handshake packet.
Sourcepub fn status_flags(&self) -> StatusFlags
pub fn status_flags(&self) -> StatusFlags
Value of a status flags.
Sourcepub fn auth_plugin_name_ref(&self) -> Option<&[u8]>
pub fn auth_plugin_name_ref(&self) -> Option<&[u8]>
Value of the auth_plugin_name field of an initial handshake packet as a byte slice.
Sourcepub fn auth_plugin_name_str(&self) -> Option<Cow<'_, str>>
pub fn auth_plugin_name_str(&self) -> Option<Cow<'_, str>>
Value of the auth_plugin_name field of an initial handshake packet as a string (lossy converted).
Sourcepub fn auth_plugin(&self) -> Option<AuthPlugin<'_>>
pub fn auth_plugin(&self) -> Option<AuthPlugin<'_>>
Auth plugin of a handshake packet
Trait Implementations§
Source§impl<'a> Clone for HandshakePacket<'a>
impl<'a> Clone for HandshakePacket<'a>
Source§fn clone(&self) -> HandshakePacket<'a>
fn clone(&self) -> HandshakePacket<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more