Struct synac::Session
[−]
[src]
pub struct Session { /* fields omitted */ }
A struct that holds the connection to synac.
Methods
impl Session
[src]
fn new<S: Into<String>, T: ToSocketAddrs>(
addr: T,
hash: S
) -> Result<Session, Error>
[src]
addr: T,
hash: S
) -> Result<Session, Error>
Create a synac session that verifies the public key against a hash.
fn new_with_verify_callback<T, F>(
addr: T,
callback: F
) -> Result<Session, Error> where
T: ToSocketAddrs,
F: Fn(bool, &mut X509StoreContextRef) -> bool + Any + 'static + Sync + Send,
[src]
addr: T,
callback: F
) -> Result<Session, Error> where
T: ToSocketAddrs,
F: Fn(bool, &mut X509StoreContextRef) -> bool + Any + 'static + Sync + Send,
Create a synac session with a custom SSL callback.
fn inner_stream(&mut self) -> &mut Stream
[src]
Returns inner connection
fn set_nonblocking(&mut self, value: bool) -> Result<(), Error>
[src]
Makes inner stream non-blocking
fn login_with_password<S: Into<String>>(
&mut self,
bot: bool,
name: S,
password: S
) -> Result<(), Error>
[src]
&mut self,
bot: bool,
name: S,
password: S
) -> Result<(), Error>
Sends the login packet with specific password.
Read the result with read
.
Warning: Strongly disencouraged. Use tokens instead, when possible.
fn login_with_token<S: Into<String>>(
&mut self,
bot: bool,
name: S,
token: S
) -> Result<(), Error>
[src]
&mut self,
bot: bool,
name: S,
token: S
) -> Result<(), Error>
Sends the login packet with specific token.
Read the result with read
.
fn write(&mut self, packet: &Packet) -> Result<(), Error>
[src]
Transmit a packet over the connection
fn read(&mut self) -> Result<Packet, Error>
[src]
Read a packet from the connection