Trait CoapEventHandler

Source
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§

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 (Q-)Block receive error.

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 of 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:

Implementors§