[][src]Struct tox_packet::relay::connection_id::ConnectionId

pub struct ConnectionId(_);

Connection ID is either a number between [16, 255] or 0. Zero can be included in a response and means that the previous request was invalid. If a connection id is a number between [16, 255] it can be uniquely mapped to a connection index between [0, 239].

Implementations

impl ConnectionId[src]

pub fn zero() -> Self[src]

Zero connection id meaning invalid request.

pub fn from_index(index: u8) -> Self[src]

Get connection id corresponding to the index.

pub fn index(self) -> Option<u8>[src]

Get index corresponding to the connection id. None if the connection id is zero.

Trait Implementations

impl Clone for ConnectionId[src]

impl Copy for ConnectionId[src]

impl Debug for ConnectionId[src]

impl Eq for ConnectionId[src]

impl FromBytes for ConnectionId[src]

impl PartialEq<ConnectionId> for ConnectionId[src]

impl StructuralEq for ConnectionId[src]

impl StructuralPartialEq for ConnectionId[src]

impl ToBytes for ConnectionId[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.