GatoPSKTLS 0.1.0

TLS 1.3 PSK client + server (no_std, no allocator). Fork of drogue-iot/embedded-tls extended with server-mode PSK_KE handshake — for embedded MQTT brokers and similar peers.
Documentation
use crate::buffer::CryptoBuffer;
use crate::record::RecordHeader;
use core::fmt::{Debug, Formatter};

pub struct ApplicationData<'a> {
    pub(crate) header: RecordHeader,
    pub(crate) data: CryptoBuffer<'a>,
}

impl Debug for ApplicationData<'_> {
    fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
        write!(f, "ApplicationData {:x?}", self.data.len())
    }
}

#[cfg(feature = "defmt")]
impl<'a> defmt::Format for ApplicationData<'a> {
    fn format(&self, f: defmt::Formatter<'_>) {
        defmt::write!(f, "ApplicationData {}", self.data.len());
    }
}

impl<'a> ApplicationData<'a> {
    pub fn new(rx_buf: CryptoBuffer<'a>, header: RecordHeader) -> ApplicationData<'a> {
        Self {
            header,
            data: rx_buf,
        }
    }
}