Skip to main content

SessionCache

Trait SessionCache 

Source
pub trait SessionCache: Send + Sync {
    // Required methods
    fn put(&self, session: Dtls12Session);
    fn get(&self, session_id: &[u8]) -> Option<Dtls12Session>;
    fn remove(&self, session_id: &[u8]);
}
Expand description

Where a DTLS 1.2 server keeps the sessions it may resume by session id (RFC 5246 sections 7.3, 7.4.1.3). A server without one gives no session id and resumes by ticket only, if it issues tickets.

Required Methods§

Source

fn put(&self, session: Dtls12Session)

Keeps session under its session id.

Source

fn get(&self, session_id: &[u8]) -> Option<Dtls12Session>

The session session_id, if it is kept.

Source

fn remove(&self, session_id: &[u8])

Forgets the session session_id (RFC 5246 7.2: its connection failed).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§