Trait optee_utee::net::SocketAdapter

source ·
pub trait SocketAdapter: Sized {
    type Setup;
    type Handle;

    // Required methods
    fn open(setup: Self::Setup) -> Result<Self::Handle, SocketError>;
    fn send(
        handle: &mut Self::Handle,
        buf: &[u8],
        timeout: u32
    ) -> Result<usize, SocketError>;
    fn recv(
        handle: &mut Self::Handle,
        buf: &mut [u8],
        timeout: u32
    ) -> Result<usize, SocketError>;
}
Expand description

A trait designed to accommodate various implementations of GP TEE Sockets API.

An implementation of this trait is responsible for handling all protocol-related tasks, including but not limited to:

  • Defining its own Setup type and using it to establish a new connection;
  • Sending and receiving data over the connection, while managing protocol errors (such as permitting certain warnings but raising others).

Required Associated Types§

Required Methods§

source

fn open(setup: Self::Setup) -> Result<Self::Handle, SocketError>

source

fn send( handle: &mut Self::Handle, buf: &[u8], timeout: u32 ) -> Result<usize, SocketError>

source

fn recv( handle: &mut Self::Handle, buf: &mut [u8], timeout: u32 ) -> Result<usize, SocketError>

Object Safety§

This trait is not object safe.

Implementors§