Struct optee_utee::net::Socket
source · pub struct Socket<T: SocketAdapter> { /* private fields */ }
Expand description
A struct used for socket operations.
Implementations§
source§impl<T: SocketAdapter> Socket<T>
impl<T: SocketAdapter> Socket<T>
sourcepub fn open(setup: T::Setup) -> Result<Self, SocketError>
pub fn open(setup: T::Setup) -> Result<Self, SocketError>
create a new connection, and then sending and receiving data over it.
sourcepub fn set_recv_timeout_in_milli(&mut self, milliseconds: u32)
pub fn set_recv_timeout_in_milli(&mut self, milliseconds: u32)
set timeout of recv operation.
sourcepub fn set_send_timeout_in_milli(&mut self, milliseconds: u32)
pub fn set_send_timeout_in_milli(&mut self, milliseconds: u32)
set timeout of send operation.
sourcepub fn set_recv_timeout(&mut self, dur: Option<Duration>) -> Result<()>
pub fn set_recv_timeout(&mut self, dur: Option<Duration>) -> Result<()>
a wrapper of set_recv_timeout_in_milli
, similar to set_read_timeout
in std::net::TcpStream, it will set timeout to TEE_TIMEOUT_INFINITE
if Option::None
is provided.
sourcepub fn set_send_timeout(&mut self, dur: Option<Duration>) -> Result<()>
pub fn set_send_timeout(&mut self, dur: Option<Duration>) -> Result<()>
a wrapper of set_send_timeout_in_milli
, similar to
set_write_timeout
in std::net::TcpStream, it will set timeout to
TEE_TIMEOUT_INFINITE
if Option::None
is provided.
Trait Implementations§
source§impl<T: SocketAdapter<Setup = Setup>> StdCompatConnect for Socket<T>
impl<T: SocketAdapter<Setup = Setup>> StdCompatConnect for Socket<T>
fn connect_v4(address: &str, port: u16) -> Result<Self, SocketError>
fn connect_v6(address: &str, port: u16) -> Result<Self, SocketError>
fn connect(address: &str, port: u16) -> Result<Self, SocketError>
source§impl<T: SocketAdapter<Setup = Setup>> StdCompatRead for Socket<T>
impl<T: SocketAdapter<Setup = Setup>> StdCompatRead for Socket<T>
fn read(&mut self, buf: &mut [u8]) -> Result<usize, SocketError>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), SocketError>
source§impl<T: SocketAdapter<Setup = Setup>> StdCompatWrite for Socket<T>
impl<T: SocketAdapter<Setup = Setup>> StdCompatWrite for Socket<T>
Auto Trait Implementations§
impl<T> Freeze for Socket<T>
impl<T> RefUnwindSafe for Socket<T>
impl<T> Send for Socket<T>
impl<T> Sync for Socket<T>
impl<T> Unpin for Socket<T>
impl<T> UnwindSafe for Socket<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more