OsSocketApi

Struct OsSocketApi 

Source
#[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

Source

pub unsafe fn init(&self)

Source

pub unsafe fn shutdown(&self)

Source

pub unsafe fn socket(&self, type_: OsSocketType) -> SocketO

Source

pub unsafe fn set_option( &self, socket: SocketO, option: OsSocketOption, enabled: bool, )

Source

pub unsafe fn bind(&self, socket: SocketO, address: SocketAddressT) -> bool

Source

pub unsafe fn getsockname( &self, socket: SocketO, address: *mut SocketAddressT, ) -> bool

Source

pub unsafe fn listen(&self, socket: SocketO, queue_size: u32) -> bool

Source

pub unsafe fn accept( &self, socket: SocketO, address: *mut SocketAddressT, ) -> SocketO

Source

pub unsafe fn connect( &self, socket: SocketO, target: SocketAddressT, ) -> OsSocketConnect

Source

pub unsafe fn send( &self, socket: SocketO, buffer: *const c_void, size: u32, ) -> i32

Source

pub unsafe fn recv( &self, socket: SocketO, buffer: *mut c_void, size: u32, ) -> i32

Source

pub unsafe fn sendto( &self, socket: SocketO, buffer: *const c_void, size: u32, target: SocketAddressT, ) -> i32

Source

pub unsafe fn recvfrom( &self, socket: SocketO, buffer: *mut c_void, size: u32, source: *mut SocketAddressT, ) -> i32

Source

pub unsafe fn close(&self, socket: SocketO) -> bool

Source

pub unsafe fn getaddrinfo( &self, name: *const c_char, service: *const c_char, addresses: *mut SocketAddressT, size: u32, ) -> u32

Source

pub unsafe fn getaddrinfo_async( &self, name: *const c_char, service: *const c_char, ) -> *mut c_void

Source

pub unsafe fn getaddrinfo_result( &self, query: *mut c_void, addresses: *mut SocketAddressT, count: *mut u32, ) -> OsSocketGetaddrinfo

Trait Implementations§

Source§

impl Api for OsSocketApi

Source§

impl Clone for OsSocketApi

Source§

fn clone(&self) -> OsSocketApi

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for OsSocketApi

Source§

fn default() -> OsSocketApi

Returns the “default value” for a type. Read more
Source§

impl Copy for OsSocketApi

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.