pub struct SocketTable { /* private fields */ }Implementations§
Source§impl SocketTable
impl SocketTable
pub fn new() -> Self
pub fn allocate(&self, owner_pid: u32, spec: SocketSpec) -> SocketRecord
pub fn allocate_with_state( &self, owner_pid: u32, spec: SocketSpec, state: SocketState, ) -> SocketRecord
pub fn get(&self, socket_id: SocketId) -> Option<SocketRecord>
pub fn update_state( &self, socket_id: SocketId, new_state: SocketState, ) -> SocketResult<SocketRecord>
pub fn bind_inet( &self, socket_id: SocketId, address: InetSocketAddress, ) -> SocketResult<SocketRecord>
pub fn set_datagram_socket_option( &self, socket_id: SocketId, option: DatagramSocketOption, enabled: bool, ) -> SocketResult<SocketRecord>
pub fn add_multicast_membership( &self, socket_id: SocketId, membership: SocketMulticastMembership, ) -> SocketResult<SocketRecord>
pub fn drop_multicast_membership( &self, socket_id: SocketId, membership: SocketMulticastMembership, ) -> SocketResult<SocketRecord>
pub fn bind_unix( &self, socket_id: SocketId, path: impl Into<String>, ) -> SocketResult<SocketRecord>
pub fn listen( &self, socket_id: SocketId, backlog: usize, ) -> SocketResult<SocketRecord>
pub fn enqueue_incoming_tcp_connection( &self, listener_socket_id: SocketId, peer_address: InetSocketAddress, ) -> SocketResult<()>
pub fn accept(&self, listener_socket_id: SocketId) -> SocketResult<SocketRecord>
pub fn connect_pair( &self, socket_id: SocketId, peer_socket_id: SocketId, ) -> SocketResult<(SocketRecord, SocketRecord)>
pub fn find_bound_inet_socket( &self, spec: SocketSpec, address: &InetSocketAddress, ) -> Option<SocketRecord>
pub fn connect_to_bound_inet_stream( &self, socket_id: SocketId, target_address: InetSocketAddress, ) -> SocketResult<()>
pub fn find_bound_unix_socket(&self, path: &str) -> Option<SocketRecord>
pub fn connect_to_bound_unix_stream( &self, socket_id: SocketId, target_path: impl Into<String>, ) -> SocketResult<()>
pub fn send_to_bound_udp_socket( &self, socket_id: SocketId, target_address: InetSocketAddress, data: &[u8], ) -> SocketResult<usize>
pub fn check_send_to_bound_udp_socket( &self, socket_id: SocketId, target_address: InetSocketAddress, ) -> SocketResult<()>
pub fn recv_datagram( &self, socket_id: SocketId, max_bytes: usize, ) -> SocketResult<Option<ReceivedDatagram>>
pub fn poll( &self, socket_id: SocketId, requested: PollEvents, ) -> SocketResult<PollEvents>
pub fn write(&self, socket_id: SocketId, data: &[u8]) -> SocketResult<usize>
pub fn check_write(&self, socket_id: SocketId) -> SocketResult<()>
pub fn read( &self, socket_id: SocketId, max_bytes: usize, ) -> SocketResult<Option<Vec<u8>>>
pub fn shutdown( &self, socket_id: SocketId, how: SocketShutdown, ) -> SocketResult<SocketRecord>
pub fn remove(&self, socket_id: SocketId) -> SocketResult<SocketRecord>
pub fn remove_all_for_pid(&self, owner_pid: u32) -> Vec<SocketRecord>
pub fn snapshot(&self) -> SocketTableSnapshot
Trait Implementations§
Source§impl Clone for SocketTable
impl Clone for SocketTable
Source§fn clone(&self) -> SocketTable
fn clone(&self) -> SocketTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SocketTable
impl Debug for SocketTable
Source§impl Default for SocketTable
impl Default for SocketTable
Source§fn default() -> SocketTable
fn default() -> SocketTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SocketTable
impl RefUnwindSafe for SocketTable
impl Send for SocketTable
impl Sync for SocketTable
impl Unpin for SocketTable
impl UnsafeUnpin for SocketTable
impl UnwindSafe for SocketTable
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more