[][src]Struct oni_simulator::Socket

pub struct Socket<MTU: ArrayLength<u8> = DefaultMTU> { /* fields omitted */ }

Simulated unreliable unordered connectionless UDP-like socket.

Methods

impl<MTU: ArrayLength<u8>> Socket<MTU>
[src]

Takes the value of the counter sent bytes and clear counter.

Takes the value of the counter received bytes and clear counter.

Returns the socket address that this socket was created from.

Sends data on the socket to the given address. On success, returns the number of bytes written.

This will return an error when the length of buf is greater than MTU.

Receives a single datagram message on the socket. On success, returns the number of bytes read and the origin.

The function must be called with valid byte array buf of sufficient size to hold the message bytes. If a message is too long to fit in the supplied buffer, excess bytes may be discarded.

Trait Implementations

impl<MTU: ArrayLength<u8>> Drop for Socket<MTU>
[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<MTU> Send for Socket<MTU>

impl<MTU> Sync for Socket<MTU>

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Same for T

Should always be Self