pub struct Connection {
pub stream: TcpStream,
pub password_hash_algo: PasswordHashAlgo,
pub password_hash_iterations: u32,
pub totp: bool,
pub nonce: Vec<u8>,
pub compression: Compression,
pub escape_commands: bool,
}
Expand description
A TCP connection to the WeeChat relay, along with the configuration for the connection, likely negotiated in a handshake.
Fields§
§stream: TcpStream
§password_hash_algo: PasswordHashAlgo
§password_hash_iterations: u32
§totp: bool
§nonce: Vec<u8>
§compression: Compression
§escape_commands: bool
Implementations§
Source§impl Connection
impl Connection
Sourcepub fn new(
stream: TcpStream,
handshake: Option<HandshakeCommand>,
) -> Result<Self, WeechatError>
pub fn new( stream: TcpStream, handshake: Option<HandshakeCommand>, ) -> Result<Self, WeechatError>
Sourcepub fn send_command<T: CommandType>(
&mut self,
command: &Command<T>,
) -> Result<(), WeechatError>
pub fn send_command<T: CommandType>( &mut self, command: &Command<T>, ) -> Result<(), WeechatError>
Send a single command on the Connection
.
Sourcepub fn send_commands(
&mut self,
commands: &mut dyn Iterator<Item = &DynCommand>,
) -> Result<(), WeechatError>
pub fn send_commands( &mut self, commands: &mut dyn Iterator<Item = &DynCommand>, ) -> Result<(), WeechatError>
Send a series of commands on the Connection
.
Sourcepub fn get_message(
&mut self,
) -> Result<Message, ParseMessageError<Error<Vec<u8>>>>
pub fn get_message( &mut self, ) -> Result<Message, ParseMessageError<Error<Vec<u8>>>>
Get a response on the Connection
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more