pub fn new(
        sn: Sn,
        src_port: u16,
        hostname: Hostname<'hn>,
        dst: SocketAddrV4,
        identity: &'psk [u8],
        psk: &'psk [u8],
        rx: &'b mut [u8; N],
    ) -> Self {
        Self {
            sn,
            src_port,
            hostname,
            dst,
            state: State::Reset,
            timeout: None,
            key_schedule: KeySchedule::default(),
            identity,
            psk,
            rx: Buffer::from(rx),
        }
    }
/// Create a new TLS client.
///
/// You must resolve the hostname to an [`Ipv4Addr`] externally.
///
/// # Arguments
///
/// * `sn` Socket number for the TLS client.
/// * `src_port` Source port, use any unused port.
/// * `hostname` Server hostname.
/// * `dst` Server address.
/// * `identity` PSK identity
/// * `psk` pre-shared key
/// * `rx` RX buffer, this must be 1024, 2048, 4096, 8192, or 16384 bytes
///   in length
///
/// # Example
///
/// ```
/// # const MY_KEY: [u8; 1] = [0];
/// use w5500_tls::{
///     Client,
///     {
///         hl::Hostname,
///         ll::{
///             net::{Ipv4Addr, SocketAddrV4},
///             Sn,
///         },
///     },
/// };
///
/// static mut RX: [u8; 2048] = [0; 2048];
///
/// const DST: SocketAddrV4 = SocketAddrV4::new(Ipv4Addr::new(192, 168, 0, 4), 8883);
/// const HOSTNAME: Hostname = Hostname::new_unwrapped("server.local");
/// const SRC_PORT: u16 = 1234;
/// const TLS_SN: Sn = Sn::Sn4;
///
/// let tls_client: Client<2048> = Client::new(
///     TLS_SN,
///     SRC_PORT,
///     HOSTNAME,
///     DST,
///     b"mykeyidentity",
///     &MY_KEY,
///     unsafe { &mut RX },
/// );
/// ```
///
/// [`Ipv4Addr`]: w5500_hl::ll::net::Ipv4Addr
Create a new TLS client.
You must resolve the hostname to an [`Ipv4Addr`] externally.
Create a new TLS client . You must resolve the hostname to an [ ` Ipv4Addr ` ] externally .
pub fn new(
        sn: Sn,
        src_port: u16,
        hostname: Hostname<'hn>,
        dst: SocketAddrV4,
        identity: &'psk [u8],
        psk: &'psk [u8],
        rx: &'b mut [u8; N],
    ) -> Self {
        Self {
            sn,
            src_port,
            hostname,
            dst,
            state: State::Reset,
            timeout: None,
            key_schedule: KeySchedule::default(),
            identity,
            psk,
            rx: Buffer::from(rx),
        }
    }
pub fn new ( sn : Sn , src_port : u16 , hostname : Hostname < ' hn > , dst : SocketAddrV4 , identity : & ' psk [ u8 ] , psk : & ' psk [ u8 ] , rx : & ' b mut [ u8 ; N ] , ) -> Self { Self { sn , src_port , hostname , dst , state : State :: Reset , timeout : None , key_schedule : KeySchedule :: default ( ) , identity , psk , rx : Buffer :: from ( rx ) , } }
Create a new TLS client.
Create a new TLS client .
sn
Sn
src_port
u16
hostname
Hostname<'hn>
dst
SocketAddrV4
identity
&'psk [u8]
psk
&'psk [u8]
rx
&'b mut [u8; N]
sn
Sn
src_port
u16
hostname
Hostname<'hn>
dst
SocketAddrV4
identity
&'psk [u8]
psk
&'psk [u8]
rx
&'b mut [u8; N]
example
None
const my_key: [u8; 1] = [0];




const DST: SocketAddrV4 = SocketAddrV4::new(Ipv4Addr::new(192, 168, 0, 4), 8883);
const HOSTNAME: Hostname = Hostname::new_unwrapped("server.local");
const SRC_PORT: u16 = 1234;
const TLS_SN: Sn = Sn::Sn4.

let tls_client: Client<2048> = Client::new(
TLS_SN,
SRC_PORT,
HOSTNAME,
DST,
b"mykeyidentity",
&MY_KEY,
unsafe { &mut RX },
);
```


const DST : SocketAddrV4 = SocketAddrV4 :: new ( Ipv4Addr :: new ( 192 168 0 4 ) 8883 ) ; const HOSTNAME : Hostname = Hostname :: new_unwrapped ( " server . local " ) ; const SRC_PORT : u16 = 1234 ; const TLS_SN : Sn = Sn :: Sn4 . let tls_client : Client<2048 > = Client :: new ( TLS_SN SRC_PORT HOSTNAME DST b " mykeyidentity " &MY_KEY unsafe { &mut RX } ) ; ` ` `