pub trait CoapEventHandler: Debug {
Show 13 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_server_session_new(&mut self, session: &mut CoapServerSession<'_>) { ... }
fn handle_server_session_del(&mut self, session: &mut CoapServerSession<'_>) { ... }
}
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 (Q-)Block receive error.
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 of 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())