Struct uosql::Connection [] [src]

pub struct Connection {
    // some fields omitted
}

Stores TCPConnection with a server. Contains IP, Port, Login data and greeting from server.

Methods

impl Connection

fn connect(addr: String, port: u16, usern: String, passwd: String) -> Result<Connection, Error>

Establish connection to specified address and port.

fn ping(&mut self) -> Result<(), Error>

Send ping-command to server and receive Ok-package

fn quit(&mut self) -> Result<(), Error>

Send quit-command to server and receive Ok-package

fn execute(&mut self, query: String) -> Result<DataSet, Error>

fn get_version(&self) -> u8

Return server version number.

fn get_message(&self) -> &str

Return server greeting message.

fn get_ip(&self) -> &str

Return ip address for current connection.

fn get_port(&self) -> u16

Return port for current connection.

fn get_username(&self) -> &str

Return username used for current connection authentication.