pub struct SocketTable { /* private fields */ }Implementations§
Source§impl SocketTable
impl SocketTable
pub fn new() -> Self
Sourcepub fn set_resource_ledger(
&self,
ledger: Arc<ResourceLedger>,
) -> SocketResult<()>
pub fn set_resource_ledger( &self, ledger: Arc<ResourceLedger>, ) -> SocketResult<()>
Install the VM ledger before any socket is created. The table owns reservations only for data physically retained in kernel queues.
pub fn has_resource_ledger(&self) -> bool
pub fn buffered_byte_capacity_available(&self) -> bool
pub fn datagram_capacity_available(&self) -> bool
pub fn set_readiness_sink<F>(&self, sink: Option<F>)
pub fn allocate( &self, owner_pid: u32, spec: SocketSpec, ) -> SocketResult<SocketRecord>
pub fn allocate_with_state( &self, owner_pid: u32, spec: SocketSpec, state: SocketState, ) -> SocketResult<SocketRecord>
pub fn get(&self, socket_id: SocketId) -> Option<SocketRecord>
pub fn reassign_owner( &self, socket_id: SocketId, owner_pid: u32, ) -> SocketResult<()>
pub fn records_for_owner(&self, owner_pid: u32) -> Vec<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 connect_bound_udp_socket( &self, socket_id: SocketId, peer_address: InetSocketAddress, ) -> SocketResult<()>
pub fn disconnect_bound_udp_socket( &self, socket_id: SocketId, ) -> SocketResult<()>
pub fn send_connected_udp_socket( &self, socket_id: SocketId, 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 recv_datagram_charged( &self, socket_id: SocketId, max_bytes: usize, ) -> SocketResult<Option<ChargedReceivedDatagram>>
pub fn poll( &self, socket_id: SocketId, requested: PollEvents, ) -> SocketResult<PollEvents>
pub fn write(&self, socket_id: SocketId, data: &[u8]) -> SocketResult<usize>
pub fn send_message( &self, socket_id: SocketId, data: &[u8], rights: Vec<TransferredSocketRight>, ) -> 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 recv_message( &self, socket_id: SocketId, max_bytes: usize, peek: bool, ) -> SocketResult<Option<ReceivedSocketMessage>>
pub fn next_message_rights_count( &self, socket_id: SocketId, ) -> SocketResult<usize>
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