Struct fake_netstack::StreamSocket
source · pub(crate) struct StreamSocket {
pub(crate) domain: Domain,
pub(crate) protocol: StreamSocketProtocol,
pub(crate) control_handle: StreamSocketControlHandle,
pub(crate) state: StreamSocketState,
pub(crate) receive_buffer_size: u64,
pub(crate) send_buffer_size: u64,
pub(crate) local_socket: Option<Socket>,
pub(crate) peer_socket: Socket,
}
Fields§
§domain: Domain
§protocol: StreamSocketProtocol
§control_handle: StreamSocketControlHandle
§state: StreamSocketState
§receive_buffer_size: u64
§send_buffer_size: u64
§local_socket: Option<Socket>
§peer_socket: Socket
Implementations§
source§impl StreamSocket
impl StreamSocket
pub(crate) fn new( protocol: StreamSocketProtocol, domain: Domain, control_handle: StreamSocketControlHandle ) -> Self
pub(crate) fn bind( cell: &Rc<RefCell<Self>>, addr: SocketAddress, sockets: &mut HashMap<SocketAddress, Rc<RefCell<StreamSocket>>> ) -> Result<(), Errno>
pub(crate) fn connect( cell: &Rc<RefCell<Self>>, addr: SocketAddress, sockets: &mut HashMap<SocketAddress, Rc<RefCell<StreamSocket>>> ) -> Result<Tagged<Rc<RefCell<StreamSocket>>, StreamSocketRequestStream>, Errno>
pub(crate) fn listen(&mut self) -> Result<(), Errno>
pub(crate) fn accept( &mut self ) -> Result<(SocketAddress, ClientEnd<StreamSocketMarker>), Errno>
pub(crate) fn close( &self, sockets: &mut HashMap<SocketAddress, Rc<RefCell<StreamSocket>>> )
pub(crate) fn get_sock_name(&self) -> Result<SocketAddress, Errno>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for StreamSocket
impl Send for StreamSocket
impl Sync for StreamSocket
impl Unpin for StreamSocket
impl !UnwindSafe for StreamSocket
Blanket Implementations§
§impl<T> Encode<Ambiguous1> for T
impl<T> Encode<Ambiguous1> for T
§impl<T> Encode<Ambiguous2> for T
impl<T> Encode<Ambiguous2> for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.