pub struct TCPNetworkEncoder<W: AsyncWrite + Unpin> {
writer: EncryptionWriter<W>,
}Expand description
Encoder: Server -> Client
Supports ZLib endecoding/compression
Supports Aes128 Encryption
Fields§
§writer: EncryptionWriter<W>Implementations§
Source§impl<W: AsyncWrite + Unpin> TCPNetworkEncoder<W>
impl<W: AsyncWrite + Unpin> TCPNetworkEncoder<W>
Sourcepub fn set_encryption(&mut self, key: &[u8; 16])
pub fn set_encryption(&mut self, key: &[u8; 16])
NOTE: Encryption can only be set; a minecraft stream cannot go back to being unencrypted
§Panics
- If the stream is already encrypted.
- If the key is invalid.
Sourcepub async fn write_packet(
&mut self,
packet: &EncodedPacket,
) -> Result<(), PacketError>
pub async fn write_packet( &mut self, packet: &EncodedPacket, ) -> Result<(), PacketError>
Auto Trait Implementations§
impl<W> Freeze for TCPNetworkEncoder<W>where
W: Freeze,
impl<W> RefUnwindSafe for TCPNetworkEncoder<W>where
W: RefUnwindSafe,
impl<W> Send for TCPNetworkEncoder<W>where
W: Send,
impl<W> Sync for TCPNetworkEncoder<W>where
W: Sync,
impl<W> Unpin for TCPNetworkEncoder<W>
impl<W> UnsafeUnpin for TCPNetworkEncoder<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for TCPNetworkEncoder<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>