1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::extensions::messages::EncryptedExtensionsExtension;

use crate::parse_buffer::ParseBuffer;
use crate::TlsError;
use heapless::Vec;

#[derive(Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct EncryptedExtensions<'a> {
    extensions: Vec<EncryptedExtensionsExtension<'a>, 16>,
}

impl<'a> EncryptedExtensions<'a> {
    pub fn parse(buf: &mut ParseBuffer<'a>) -> Result<EncryptedExtensions<'a>, TlsError> {
        EncryptedExtensionsExtension::parse_vector(buf).map(|extensions| Self { extensions })
    }
}