Skip to main content

PlatformSocketHelpers

Trait PlatformSocketHelpers 

Source
pub trait PlatformSocketHelpers {
    // Required methods
    fn set_non_blocking(sock: *const c_void) -> i8;
    fn accept(sock_in: *const c_void, sock_out: *mut c_void) -> i8;
    fn close(sock: *mut c_void);
    fn wait_event(peers: *mut c_void, mutex: *mut c_void) -> i8;
}
Expand description

Socket helper operations called by zenoh-pico’s transport layer.

Unprefixed method names: dispatch via <ConcretePlatform as PlatformSocketHelpers>::set_non_blocking(...). Note that the close method here is the socket-layer close (shutdown + close) used by zenoh-pico’s generic helpers; PlatformTcp::close is the TCP-specific close. Both exist because zenoh-pico’s C surface has both.

Required Methods§

Source

fn set_non_blocking(sock: *const c_void) -> i8

Set socket to non-blocking mode.

Source

fn accept(sock_in: *const c_void, sock_out: *mut c_void) -> i8

Accept a pending connection.

Source

fn close(sock: *mut c_void)

Close a socket (shutdown + close).

Source

fn wait_event(peers: *mut c_void, mutex: *mut c_void) -> i8

Wait for socket events (multi-threaded platforms).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§