Trait CoapEventHandler

Source
pub trait CoapEventHandler: Debug {
Show 26 methods // Provided methods fn handle_dtls_connected(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_dtls_closed(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_dtls_renegotiate(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_dtls_error(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_tcp_connected(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_tcp_closed(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_tcp_failed(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_session_connected(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_session_closed(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_session_failed(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_partial_block(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_xmit_block_fail(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_server_session_new(&mut self, session: &mut CoapServerSession<'_>) { ... } fn handle_server_session_del(&mut self, session: &mut CoapServerSession<'_>) { ... } fn handle_bad_packet(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_msg_retransmitted(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_oscore_decryption_failure( &mut self, session: &mut CoapSession<'_>, ) { ... } fn handle_oscore_not_enabled(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_oscore_no_protected_payload( &mut self, session: &mut CoapSession<'_>, ) { ... } fn handle_oscore_no_security(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_oscore_internal_error(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_oscore_decode_error(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_ws_packet_size(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_ws_connected(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_ws_closed(&mut self, session: &mut CoapSession<'_>) { ... } fn handle_keepalive_failure(&mut self, session: &mut CoapSession<'_>) { ... }
}
Expand description

Trait for CoAP event handlers.

Implementations of this trait can be provided to a CoapContext to handle various events relating to sessions.

This is the equivalent to the libcoap coap_event_handler_t type.

Provided Methods§

Source

fn handle_dtls_connected(&mut self, session: &mut CoapSession<'_>)

Handle a DTLS connected event.

This event is triggered when a DTLS session switches to the connected state.

Source

fn handle_dtls_closed(&mut self, session: &mut CoapSession<'_>)

Handle a DTLS closed event.

This event is triggered when a DTLS session is closed.

Source

fn handle_dtls_renegotiate(&mut self, session: &mut CoapSession<'_>)

Handle a DTLS renegotiation event.

This event is triggered when a DTLS renegotiation occurs.

Source

fn handle_dtls_error(&mut self, session: &mut CoapSession<'_>)

Handle a DTLS error event.

This event is triggered when a DTLS error occurs.

Source

fn handle_tcp_connected(&mut self, session: &mut CoapSession<'_>)

Handle a TCP connected event.

This event is triggered when a new TCP connection is established.

Source

fn handle_tcp_closed(&mut self, session: &mut CoapSession<'_>)

Handle a TCP closed event.

This event is triggered when a new TCP connection is closed.

Source

fn handle_tcp_failed(&mut self, session: &mut CoapSession<'_>)

Handle a TCP failed event.

Source

fn handle_session_connected(&mut self, session: &mut CoapSession<'_>)

Handle a session connected event.

This event is triggered by CSM exchanges only when reliable protocols are used.

Source

fn handle_session_closed(&mut self, session: &mut CoapSession<'_>)

Handle a session closed event.

This event is triggered by CSM exchanges only when reliable protocols are used.

Source

fn handle_session_failed(&mut self, session: &mut CoapSession<'_>)

Handle a session failed event.

This event is triggered by CSM exchanges only when reliable protocols are used.

Source

fn handle_partial_block(&mut self, session: &mut CoapSession<'_>)

Handle a partially received message.

Source

fn handle_xmit_block_fail(&mut self, session: &mut CoapSession<'_>)

Handle a failure to transmit a block.

Source

fn handle_server_session_new(&mut self, session: &mut CoapServerSession<'_>)

Handle the creation of a new server-side session.

This event is called inside the IO loop when a new server-side session is created.

Source

fn handle_server_session_del(&mut self, session: &mut CoapServerSession<'_>)

Handle the deletion of a server-side session.

This event is called inside of the IO loop when a server-side session is deleted. This can happen for a number of reasons:

Source

fn handle_bad_packet(&mut self, session: &mut CoapSession<'_>)

Handle the receival of a badly formatted packet.

Note that this only refers to packets that can’t be parsed by libcoap, i.e. valid packets that have some semantic issues and therefore can’t be parsed into a request or response object do not trigger this event.

Source

fn handle_msg_retransmitted(&mut self, session: &mut CoapSession<'_>)

Handle a retransmission event.

Source

fn handle_oscore_decryption_failure(&mut self, session: &mut CoapSession<'_>)

Handle an OSCORE decryption failure event.

Source

fn handle_oscore_not_enabled(&mut self, session: &mut CoapSession<'_>)

Handle an OSCORE not enabled event.

Source

fn handle_oscore_no_protected_payload(&mut self, session: &mut CoapSession<'_>)

Handle an OSCORE no protected payload provided event.

Source

fn handle_oscore_no_security(&mut self, session: &mut CoapSession<'_>)

Handle an OSCORE no security definition found event.

Source

fn handle_oscore_internal_error(&mut self, session: &mut CoapSession<'_>)

Handle an OSCORE internal error.

Source

fn handle_oscore_decode_error(&mut self, session: &mut CoapSession<'_>)

Handle a decoding error when parsing OSCORE options.

Source

fn handle_ws_packet_size(&mut self, session: &mut CoapSession<'_>)

Handle an oversized WebSocket packet event.

Source

fn handle_ws_connected(&mut self, session: &mut CoapSession<'_>)

Handle a WebSocket layer up event.

Source

fn handle_ws_closed(&mut self, session: &mut CoapSession<'_>)

Handle a WebSocket layer closed event.

Source

fn handle_keepalive_failure(&mut self, session: &mut CoapSession<'_>)

Handle a failure to perform a keepalive (no response to keepalive packet)

Implementors§