[][src]Struct craftio_rs::CraftReader

pub struct CraftReader<R> { /* fields omitted */ }

Wraps some stream of type R, and implements either CraftSyncReader or CraftAsyncReader (or both) based on what types R implements.

You can construct this type calling the function wrap_with_state, which requires you to specify a packet direction (are written packets server-bound or client-bound?) and a state (handshaking? login? status? play?).

This type holds some internal buffers but only allocates them when they are required.

Implementations

impl<R> CraftReader<R>[src]

pub fn wrap(inner: R, direction: PacketDirection) -> Self[src]

pub fn wrap_with_state(
    inner: R,
    direction: PacketDirection,
    state: State
) -> Self
[src]

Trait Implementations

impl<R> CraftAsyncReader for CraftReader<R> where
    R: AsyncReadExact
[src]

impl<R> CraftIo for CraftReader<R>[src]

impl<R> CraftSyncReader for CraftReader<R> where
    R: Read
[src]

impl<R> CraftWrapper<R> for CraftReader<R>[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for CraftReader<R> where
    R: RefUnwindSafe
[src]

impl<R> Send for CraftReader<R> where
    R: Send
[src]

impl<R> Sync for CraftReader<R> where
    R: Sync
[src]

impl<R> Unpin for CraftReader<R> where
    R: Unpin
[src]

impl<R> UnwindSafe for CraftReader<R> where
    R: UnwindSafe
[src]

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

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,