Trait rustun::server::HandleMessage
[−]
[src]
pub trait HandleMessage { type Method: Method; type Attribute: Attribute; type HandleCall: Future<Item = Response<Self::Method, Self::Attribute>, Error = ()>; type HandleCast: Future<Item = (), Error = ()>; type Info; fn handle_call(
&mut self,
client: SocketAddr,
message: Request<Self::Method, Self::Attribute>
) -> Self::HandleCall; fn handle_cast(
&mut self,
client: SocketAddr,
message: Indication<Self::Method, Self::Attribute>
) -> Self::HandleCast; fn handle_error(&mut self, client: SocketAddr, error: Error); fn on_init(
&mut self,
info_tx: Sender<Self::Info>,
indication_tx: IndicationSender
) { ... } fn handle_info(&mut self, info: Self::Info) { ... } }
This trait allows to handle transactions issued by clients.
Associated Types
type Method: Method
STUN method type that this implementation can handle.
type Attribute: Attribute
STUN attribute type that this implementation can handle.
type HandleCall: Future<Item = Response<Self::Method, Self::Attribute>, Error = ()>
Future
type for handling request/response transactions.
type HandleCast: Future<Item = (), Error = ()>
Future
type for handling indication transactions.
type Info
Handler specific information message type.
Required Methods
fn handle_call(
&mut self,
client: SocketAddr,
message: Request<Self::Method, Self::Attribute>
) -> Self::HandleCall
&mut self,
client: SocketAddr,
message: Request<Self::Method, Self::Attribute>
) -> Self::HandleCall
Handles the request/response transaction issued by client
.
fn handle_cast(
&mut self,
client: SocketAddr,
message: Indication<Self::Method, Self::Attribute>
) -> Self::HandleCast
&mut self,
client: SocketAddr,
message: Indication<Self::Method, Self::Attribute>
) -> Self::HandleCast
Handles the indication transaction issued by client
.
fn handle_error(&mut self, client: SocketAddr, error: Error)
Handles the error occurred while processing a transaction issued by client
.
Provided Methods
fn on_init(
&mut self,
info_tx: Sender<Self::Info>,
indication_tx: IndicationSender
)
&mut self,
info_tx: Sender<Self::Info>,
indication_tx: IndicationSender
)
Callback method which invoked after the initialization of a server.
fn handle_info(&mut self, info: Self::Info)
Handles the information message.
Implementors
impl HandleMessage for BindingHandler