[][src]Struct craftio_rs::CraftWriter

pub struct CraftWriter<W> { /* fields omitted */ }

Wraps some stream of type W, and implements either CraftSyncWriter or CraftAsyncWriter (or both) based on what types W 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<W> CraftWriter<W>[src]

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

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

Trait Implementations

impl<W> CraftAsyncWriter for CraftWriter<W> where
    W: AsyncWriteAll
[src]

impl<W> CraftIo for CraftWriter<W>[src]

impl<W> CraftSyncWriter for CraftWriter<W> where
    W: Write
[src]

impl<W> CraftWrapper<W> for CraftWriter<W>[src]

Auto Trait Implementations

impl<W> RefUnwindSafe for CraftWriter<W> where
    W: RefUnwindSafe
[src]

impl<W> Send for CraftWriter<W> where
    W: Send
[src]

impl<W> Sync for CraftWriter<W> where
    W: Sync
[src]

impl<W> Unpin for CraftWriter<W> where
    W: Unpin
[src]

impl<W> UnwindSafe for CraftWriter<W> where
    W: 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>,