pub struct Socket { /* private fields */ }Implementations§
Source§impl Socket
Inner Socket ecapsulation implementation, other socket must derive from this implementation
Each socket is associated with a socket index, which is maintain outside, e.g. a socket pool instance
impl Socket
Inner Socket ecapsulation implementation, other socket must derive from this implementation Each socket is associated with a socket index, which is maintain outside, e.g. a socket pool instance
pub fn new_socket( sock_idx: i32, sock_af: SOCKET_ADDRESS_FAMILY, sock_type: SOCKET_TYPE, proto: u8, ) -> Result<Self, RESULT>
pub fn set_reuse_addr(&mut self, is_reuse: bool) -> RESULT
pub fn set_reuse_port(&mut self, is_reuse: bool) -> RESULT
pub fn bind(&mut self, addr: &SocketAddr) -> RESULT
pub fn listen(&mut self, back_log: i32) -> RESULT
pub fn accept(&mut self, new_idx: i32) -> Result<Self, RESULT>
pub fn connect(&mut self, dst: &SocketAddr) -> RESULT
pub fn send(&mut self, buf: &[u8]) -> Result<usize, RESULT>
pub fn send_to(&mut self, dst: &SocketAddr, buf: &[u8]) -> Result<usize, RESULT>
pub fn recv(&mut self, buf: &mut [u8]) -> Result<usize, RESULT>
pub fn recv_from( &mut self, buf: &mut [u8], ) -> Result<(usize, SocketAddr), RESULT>
pub fn get_raw_fd(&self) -> RawFdType
pub fn set_send_buffer(&mut self, size: usize) -> RESULT
pub fn set_recv_buffer(&mut self, size: usize) -> RESULT
pub fn set_non_blocking(&mut self) -> RESULT
pub fn get_socket_id(&self) -> i32
pub fn is_tcp_server(&self) -> bool
pub fn set_lb_policy(&mut self, policy: SOCKET_LB_POLICY) -> RESULT
pub fn get_lb_policy(&self) -> Result<SOCKET_LB_POLICY, RESULT>
pub fn get_local_addr(&self) -> SocketAddr
pub fn get_peer_addr(&self) -> SocketAddr
pub fn get_sock_type(&self) -> SOCKET_TYPE
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Socket
impl RefUnwindSafe for Socket
impl Send for Socket
impl Sync for Socket
impl Unpin for Socket
impl UnwindSafe for Socket
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