[−][src]Struct craftio_rs::CraftWriter
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]
inner: W,
direction: PacketDirection,
state: State
) -> Self
Trait Implementations
impl<W> CraftAsyncWriter for CraftWriter<W> where
W: AsyncWriteAll,
[src]
W: AsyncWriteAll,
pub fn write_packet_async<'life0, 'async_trait, P>(
&'life0 mut self,
packet: P
) -> Pin<Box<dyn Future<Output = WriteResult<()>> + Send + 'async_trait>> where
P: Packet + Send + Sync,
P: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
packet: P
) -> Pin<Box<dyn Future<Output = WriteResult<()>> + Send + 'async_trait>> where
P: Packet + Send + Sync,
P: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
pub fn write_raw_packet_async<'a, 'life0, 'async_trait, P>(
&'life0 mut self,
packet: P
) -> Pin<Box<dyn Future<Output = WriteResult<()>> + Send + 'async_trait>> where
P: RawPacket<'a> + Send + Sync,
'a: 'async_trait,
P: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
packet: P
) -> Pin<Box<dyn Future<Output = WriteResult<()>> + Send + 'async_trait>> where
P: RawPacket<'a> + Send + Sync,
'a: 'async_trait,
P: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
impl<W> CraftIo for CraftWriter<W>
[src]
pub fn set_state(&mut self, next: State)
[src]
pub fn set_compression_threshold(&mut self, threshold: Option<i32>)
[src]
pub fn enable_encryption(
&mut self,
key: &[u8],
iv: &[u8]
) -> Result<(), CipherError>
[src]
&mut self,
key: &[u8],
iv: &[u8]
) -> Result<(), CipherError>
pub fn set_max_packet_size(&mut self, max_size: usize)
[src]
pub fn ensure_buf_capacity(&mut self, capacity: usize)
[src]
pub fn ensure_compression_buf_capacity(&mut self, capacity: usize)
[src]
impl<W> CraftSyncWriter for CraftWriter<W> where
W: Write,
[src]
W: Write,
pub fn write_packet<P>(&mut self, packet: P) -> WriteResult<()> where
P: Packet,
[src]
P: Packet,
pub fn write_raw_packet<'a, P>(&mut self, packet: P) -> WriteResult<()> where
P: RawPacket<'a>,
[src]
P: RawPacket<'a>,
impl<W> CraftWrapper<W> for CraftWriter<W>
[src]
pub fn into_inner(self) -> W
[src]
Auto Trait Implementations
impl<W> RefUnwindSafe for CraftWriter<W> where
W: RefUnwindSafe,
[src]
W: RefUnwindSafe,
impl<W> Send for CraftWriter<W> where
W: Send,
[src]
W: Send,
impl<W> Sync for CraftWriter<W> where
W: Sync,
[src]
W: Sync,
impl<W> Unpin for CraftWriter<W> where
W: Unpin,
[src]
W: Unpin,
impl<W> UnwindSafe for CraftWriter<W> where
W: UnwindSafe,
[src]
W: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,