[][src]Trait hassium_network::server::Server

pub trait Server: Send + Sync + Sized {
    fn open(url: &str) -> Option<Self>;
fn close(self) -> Self;
fn id(&self) -> ServerID;
fn state(&self) -> ServerState;
fn clients(&self) -> &[ClientID];
fn disconnect(&mut self, id: ClientID);
fn disconnect_all(&mut self);
fn send(
        &mut self,
        id: ClientID,
        msg_id: MessageID,
        data: &[u8]
    ) -> Option<Range<usize>>;
fn send_all(&mut self, id: MessageID, data: &[u8]);
fn read(&mut self) -> Option<(ClientID, MessageID, Vec<u8>)>; fn read_all(&mut self) -> Vec<(ClientID, MessageID, Vec<u8>)> { ... }
fn process(&mut self) { ... } }

Required methods

fn open(url: &str) -> Option<Self>

fn close(self) -> Self

fn id(&self) -> ServerID

fn state(&self) -> ServerState

fn clients(&self) -> &[ClientID]

fn disconnect(&mut self, id: ClientID)

fn disconnect_all(&mut self)

fn send(
    &mut self,
    id: ClientID,
    msg_id: MessageID,
    data: &[u8]
) -> Option<Range<usize>>

fn send_all(&mut self, id: MessageID, data: &[u8])

fn read(&mut self) -> Option<(ClientID, MessageID, Vec<u8>)>

Loading content...

Provided methods

fn read_all(&mut self) -> Vec<(ClientID, MessageID, Vec<u8>)>

fn process(&mut self)

Loading content...

Implementations on Foreign Types

impl Server for ()[src]

Loading content...

Implementors

Loading content...