Trait imaginet::network::Connection
source · [−]pub trait Connection: Stream<Item = Result<Event, Error>> {
fn connect<A, B>(
addr: A,
nickname: B
) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + 'static>>
where
A: ToSocketAddrs + 'static,
B: Into<Vec<u8>> + 'static,
Self: Sized;
fn send<B>(
&mut self,
message: Message,
recipients: Vec<B>
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>
where
B: Into<Vec<u8>>,
B: 'static;
fn user_list(
&mut self
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<u8>>, Error>>>>;
fn change_nickname<B>(
&mut self,
nickname: B
) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>
where
B: Into<Vec<u8>>,
B: 'static;
}
Expand description
A network connection.
Required methods
Creates a connection.
Sends a message.
Obtains a list of all connected users.