#[repr(C)]pub struct OsSocketApi {Show 17 fields
pub init: Option<unsafe extern "C" fn()>,
pub shutdown: Option<unsafe extern "C" fn()>,
pub socket: Option<unsafe extern "C" fn(type_: OsSocketType) -> SocketO>,
pub set_option: Option<unsafe extern "C" fn(socket: SocketO, option: OsSocketOption, enabled: bool)>,
pub bind: Option<unsafe extern "C" fn(socket: SocketO, address: SocketAddressT) -> bool>,
pub getsockname: Option<unsafe extern "C" fn(socket: SocketO, address: *mut SocketAddressT) -> bool>,
pub listen: Option<unsafe extern "C" fn(socket: SocketO, queue_size: u32) -> bool>,
pub accept: Option<unsafe extern "C" fn(socket: SocketO, address: *mut SocketAddressT) -> SocketO>,
pub connect: Option<unsafe extern "C" fn(socket: SocketO, target: SocketAddressT) -> OsSocketConnect>,
pub send: Option<unsafe extern "C" fn(socket: SocketO, buffer: *const c_void, size: u32) -> i32>,
pub recv: Option<unsafe extern "C" fn(socket: SocketO, buffer: *mut c_void, size: u32) -> i32>,
pub sendto: Option<unsafe extern "C" fn(socket: SocketO, buffer: *const c_void, size: u32, target: SocketAddressT) -> i32>,
pub recvfrom: Option<unsafe extern "C" fn(socket: SocketO, buffer: *mut c_void, size: u32, source: *mut SocketAddressT) -> i32>,
pub close: Option<unsafe extern "C" fn(socket: SocketO) -> bool>,
pub getaddrinfo: Option<unsafe extern "C" fn(name: *const c_char, service: *const c_char, addresses: *mut SocketAddressT, size: u32) -> u32>,
pub getaddrinfo_async: Option<unsafe extern "C" fn(name: *const c_char, service: *const c_char) -> *mut c_void>,
pub getaddrinfo_result: Option<unsafe extern "C" fn(query: *mut c_void, addresses: *mut SocketAddressT, count: *mut u32) -> OsSocketGetaddrinfo>,
}
Fields§
§init: Option<unsafe extern "C" fn()>
§shutdown: Option<unsafe extern "C" fn()>
§socket: Option<unsafe extern "C" fn(type_: OsSocketType) -> SocketO>
§set_option: Option<unsafe extern "C" fn(socket: SocketO, option: OsSocketOption, enabled: bool)>
§bind: Option<unsafe extern "C" fn(socket: SocketO, address: SocketAddressT) -> bool>
§getsockname: Option<unsafe extern "C" fn(socket: SocketO, address: *mut SocketAddressT) -> bool>
§listen: Option<unsafe extern "C" fn(socket: SocketO, queue_size: u32) -> bool>
§accept: Option<unsafe extern "C" fn(socket: SocketO, address: *mut SocketAddressT) -> SocketO>
§connect: Option<unsafe extern "C" fn(socket: SocketO, target: SocketAddressT) -> OsSocketConnect>
§send: Option<unsafe extern "C" fn(socket: SocketO, buffer: *const c_void, size: u32) -> i32>
§recv: Option<unsafe extern "C" fn(socket: SocketO, buffer: *mut c_void, size: u32) -> i32>
§sendto: Option<unsafe extern "C" fn(socket: SocketO, buffer: *const c_void, size: u32, target: SocketAddressT) -> i32>
§recvfrom: Option<unsafe extern "C" fn(socket: SocketO, buffer: *mut c_void, size: u32, source: *mut SocketAddressT) -> i32>
§close: Option<unsafe extern "C" fn(socket: SocketO) -> bool>
§getaddrinfo: Option<unsafe extern "C" fn(name: *const c_char, service: *const c_char, addresses: *mut SocketAddressT, size: u32) -> u32>
§getaddrinfo_async: Option<unsafe extern "C" fn(name: *const c_char, service: *const c_char) -> *mut c_void>
§getaddrinfo_result: Option<unsafe extern "C" fn(query: *mut c_void, addresses: *mut SocketAddressT, count: *mut u32) -> OsSocketGetaddrinfo>
Implementations§
Source§impl OsSocketApi
impl OsSocketApi
pub unsafe fn init(&self)
pub unsafe fn shutdown(&self)
pub unsafe fn socket(&self, type_: OsSocketType) -> SocketO
pub unsafe fn set_option( &self, socket: SocketO, option: OsSocketOption, enabled: bool, )
pub unsafe fn bind(&self, socket: SocketO, address: SocketAddressT) -> bool
pub unsafe fn getsockname( &self, socket: SocketO, address: *mut SocketAddressT, ) -> bool
pub unsafe fn listen(&self, socket: SocketO, queue_size: u32) -> bool
pub unsafe fn accept( &self, socket: SocketO, address: *mut SocketAddressT, ) -> SocketO
pub unsafe fn connect( &self, socket: SocketO, target: SocketAddressT, ) -> OsSocketConnect
pub unsafe fn send( &self, socket: SocketO, buffer: *const c_void, size: u32, ) -> i32
pub unsafe fn recv( &self, socket: SocketO, buffer: *mut c_void, size: u32, ) -> i32
pub unsafe fn sendto( &self, socket: SocketO, buffer: *const c_void, size: u32, target: SocketAddressT, ) -> i32
pub unsafe fn recvfrom( &self, socket: SocketO, buffer: *mut c_void, size: u32, source: *mut SocketAddressT, ) -> i32
pub unsafe fn close(&self, socket: SocketO) -> bool
pub unsafe fn getaddrinfo( &self, name: *const c_char, service: *const c_char, addresses: *mut SocketAddressT, size: u32, ) -> u32
pub unsafe fn getaddrinfo_async( &self, name: *const c_char, service: *const c_char, ) -> *mut c_void
pub unsafe fn getaddrinfo_result( &self, query: *mut c_void, addresses: *mut SocketAddressT, count: *mut u32, ) -> OsSocketGetaddrinfo
Trait Implementations§
Source§impl Clone for OsSocketApi
impl Clone for OsSocketApi
Source§fn clone(&self) -> OsSocketApi
fn clone(&self) -> OsSocketApi
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for OsSocketApi
impl Default for OsSocketApi
Source§fn default() -> OsSocketApi
fn default() -> OsSocketApi
Returns the “default value” for a type. Read more
impl Copy for OsSocketApi
Auto Trait Implementations§
impl Freeze for OsSocketApi
impl RefUnwindSafe for OsSocketApi
impl Send for OsSocketApi
impl Sync for OsSocketApi
impl Unpin for OsSocketApi
impl UnwindSafe for OsSocketApi
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