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§
Sourcefn handle_dtls_connected(&mut self, session: &mut CoapSession<'_>)
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.
Sourcefn handle_dtls_closed(&mut self, session: &mut CoapSession<'_>)
fn handle_dtls_closed(&mut self, session: &mut CoapSession<'_>)
Handle a DTLS closed event.
This event is triggered when a DTLS session is closed.
Sourcefn handle_dtls_renegotiate(&mut self, session: &mut CoapSession<'_>)
fn handle_dtls_renegotiate(&mut self, session: &mut CoapSession<'_>)
Handle a DTLS renegotiation event.
This event is triggered when a DTLS renegotiation occurs.
Sourcefn handle_dtls_error(&mut self, session: &mut CoapSession<'_>)
fn handle_dtls_error(&mut self, session: &mut CoapSession<'_>)
Handle a DTLS error event.
This event is triggered when a DTLS error occurs.
Sourcefn handle_tcp_connected(&mut self, session: &mut CoapSession<'_>)
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.
Sourcefn handle_tcp_closed(&mut self, session: &mut CoapSession<'_>)
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.
Sourcefn handle_tcp_failed(&mut self, session: &mut CoapSession<'_>)
fn handle_tcp_failed(&mut self, session: &mut CoapSession<'_>)
Handle a TCP failed event.
Sourcefn handle_session_connected(&mut self, session: &mut CoapSession<'_>)
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.
Sourcefn handle_session_closed(&mut self, session: &mut CoapSession<'_>)
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.
Sourcefn handle_session_failed(&mut self, session: &mut CoapSession<'_>)
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.
Sourcefn handle_partial_block(&mut self, session: &mut CoapSession<'_>)
fn handle_partial_block(&mut self, session: &mut CoapSession<'_>)
Handle a partially received message.
Sourcefn handle_xmit_block_fail(&mut self, session: &mut CoapSession<'_>)
fn handle_xmit_block_fail(&mut self, session: &mut CoapSession<'_>)
Handle a failure to transmit a block.
Sourcefn handle_server_session_new(&mut self, session: &mut CoapServerSession<'_>)
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.
Sourcefn handle_server_session_del(&mut self, session: &mut CoapServerSession<'_>)
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:
- The session has been idle for too long (see CoapContext::session_timeout() and CoapContext::set_session_timeout())
- The maximum number of handshaking sessions is exceeded (see CoapContext::max_handshake_sessions() and CoapContext::set_max_handshake_sessions())
- The maximum number of idle sessions is exceeded (see CoapContext::max_idle_sessions() and CoapContext::set_max_idle_sessions())
Sourcefn handle_bad_packet(&mut self, session: &mut CoapSession<'_>)
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.
Sourcefn handle_msg_retransmitted(&mut self, session: &mut CoapSession<'_>)
fn handle_msg_retransmitted(&mut self, session: &mut CoapSession<'_>)
Handle a retransmission event.
Sourcefn handle_oscore_decryption_failure(&mut self, session: &mut CoapSession<'_>)
fn handle_oscore_decryption_failure(&mut self, session: &mut CoapSession<'_>)
Handle an OSCORE decryption failure event.
Sourcefn handle_oscore_not_enabled(&mut self, session: &mut CoapSession<'_>)
fn handle_oscore_not_enabled(&mut self, session: &mut CoapSession<'_>)
Handle an OSCORE not enabled event.
Sourcefn handle_oscore_no_protected_payload(&mut self, session: &mut CoapSession<'_>)
fn handle_oscore_no_protected_payload(&mut self, session: &mut CoapSession<'_>)
Handle an OSCORE no protected payload provided event.
Sourcefn handle_oscore_no_security(&mut self, session: &mut CoapSession<'_>)
fn handle_oscore_no_security(&mut self, session: &mut CoapSession<'_>)
Handle an OSCORE no security definition found event.
Sourcefn handle_oscore_internal_error(&mut self, session: &mut CoapSession<'_>)
fn handle_oscore_internal_error(&mut self, session: &mut CoapSession<'_>)
Handle an OSCORE internal error.
Sourcefn handle_oscore_decode_error(&mut self, session: &mut CoapSession<'_>)
fn handle_oscore_decode_error(&mut self, session: &mut CoapSession<'_>)
Handle a decoding error when parsing OSCORE options.
Sourcefn handle_ws_packet_size(&mut self, session: &mut CoapSession<'_>)
fn handle_ws_packet_size(&mut self, session: &mut CoapSession<'_>)
Handle an oversized WebSocket packet event.
Sourcefn handle_ws_connected(&mut self, session: &mut CoapSession<'_>)
fn handle_ws_connected(&mut self, session: &mut CoapSession<'_>)
Handle a WebSocket layer up event.
Sourcefn handle_ws_closed(&mut self, session: &mut CoapSession<'_>)
fn handle_ws_closed(&mut self, session: &mut CoapSession<'_>)
Handle a WebSocket layer closed event.
Sourcefn handle_keepalive_failure(&mut self, session: &mut CoapSession<'_>)
fn handle_keepalive_failure(&mut self, session: &mut CoapSession<'_>)
Handle a failure to perform a keepalive (no response to keepalive packet)