pub struct UauSock { /* private fields */ }
Expand description
Wrap raw data
Implementations§
source§impl UauSock
impl UauSock
sourcepub fn new(addr: &[u8], recv_timeout: Option<i64>) -> Result<Self>
pub fn new(addr: &[u8], recv_timeout: Option<i64>) -> Result<Self>
NOTE:
The Unix Socket that needs to receive messages must be bound to an explicit address; If you send msg anonymously, you will not receive the reply msg from the peer.
So the addr
parameter should not be empty.
sourcepub fn recvonly_64(&self) -> Result<Vec<u8>>
pub fn recvonly_64(&self) -> Result<Vec<u8>>
Receive msg with a 64-bytes buffer
sourcepub fn recvonly_128(&self) -> Result<Vec<u8>>
pub fn recvonly_128(&self) -> Result<Vec<u8>>
Receive msg with a 128-bytes buffer
sourcepub fn recvonly_256(&self) -> Result<Vec<u8>>
pub fn recvonly_256(&self) -> Result<Vec<u8>>
Receive msg with a 256-bytes buffer
sourcepub fn recvonly_512(&self) -> Result<Vec<u8>>
pub fn recvonly_512(&self) -> Result<Vec<u8>>
Receive msg with a 512-bytes buffer
sourcepub fn recvonly_1024(&self) -> Result<Vec<u8>>
pub fn recvonly_1024(&self) -> Result<Vec<u8>>
Receive msg with a 1024-bytes buffer
sourcepub fn recv(&self, buf: &mut [u8]) -> Result<(usize, UnixAddr)>
pub fn recv(&self, buf: &mut [u8]) -> Result<(usize, UnixAddr)>
Receive msg with a given buffer
sourcepub fn addr_to_sock(addr: &[u8]) -> Result<UnixAddr>
pub fn addr_to_sock(addr: &[u8]) -> Result<UnixAddr>
Try to convert a user-given addr to SockAddr(unix sock)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UauSock
impl RefUnwindSafe for UauSock
impl Send for UauSock
impl Sync for UauSock
impl Unpin for UauSock
impl UnwindSafe for UauSock
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