Trait crystalorb::network_resource::Connection[][src]

pub trait Connection {
    fn recv<MessageType>(&mut self) -> Option<MessageType>
    where
        MessageType: Debug + Clone + Serialize + DeserializeOwned + Send + Sync + 'static
;
fn send<MessageType>(&mut self, message: MessageType) -> Option<MessageType>
    where
        MessageType: Debug + Clone + Serialize + DeserializeOwned + Send + Sync + 'static
;
fn flush<MessageType>(&mut self)
    where
        MessageType: Debug + Clone + Serialize + DeserializeOwned + Send + Sync + 'static
; }
Expand description

Representation of a connection to a specific remote machine that allows CrystalOrb to send and receive messages.

Required methods

Interface for CrystalOrb to request the next message received, if there is one.

CrystalOrb will invoke this method with the three message types as specified in NetworkResource.

Interface for CrystalOrb to try sending a message to the connection’s destination. If unsuccessful, the message should be returned. Otherwise, None should be returned.

CrystalOrb will invoke this method with the three message types as specified in NetworkResource.

Interface that CrystalOrb would use to ensure that any pending messages are sent.

CrystalOrb will invoke this method with the three message types as specified in NetworkResource.

Implementors