[][src]Struct muoxi_staging::comms::Client

pub struct Client {
    pub uid: UID,
    pub state: ConnStates,
    pub lines: Framed<TcpStream, LinesCodec>,
    pub addr: SocketAddr,
    rx: Rx,
}

Wrapper around connected socket, this is non-persistent data and only valid within the main process.

Fields

uid: UID

unique id for client

state: ConnStates

current state of connected client

lines: Framed<TcpStream, LinesCodec>

encodes and decodes incoming streams

addr: SocketAddr

socket address of connected client

rx: Rx

Methods

impl Client[src]

pub async fn new(
    uid: UID,
    server: Arc<Mutex<Server>>,
    stream: TcpStream
) -> Result<Self>
[src]

asyncronously create a new client instance this instance of client is only valid during the duration of the time spent alive and connected to server

Trait Implementations

impl Debug for Client[src]

impl Stream for Client[src]

type Item = Result<Message, LinesCodecError>

Values yielded by the stream.

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

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> IntoSql for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<St> StreamExt for St where
    St: Stream + ?Sized
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

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.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,