[−][src]Struct craftio_rs::CraftConnection
Implementations
impl<R, W> CraftConnection<R, W>
[src]
pub fn into_split(self) -> (CraftReader<R>, CraftWriter<W>)
[src]
pub fn split(&mut self) -> (&mut CraftReader<R>, &mut CraftWriter<W>)
[src]
impl CraftConnection<BufReader<TcpStream>, TcpStream>
[src]
pub fn connect_server_std<A>(to: A) -> Result<Self, Error> where
A: ToSocketAddrs,
[src]
A: ToSocketAddrs,
pub fn wrap_client_stream_std(stream: TcpStream) -> Result<Self, Error>
[src]
pub fn from_std(
s1: TcpStream,
read_direction: PacketDirection
) -> Result<Self, Error>
[src]
s1: TcpStream,
read_direction: PacketDirection
) -> Result<Self, Error>
pub fn from_std_with_state(
s1: TcpStream,
read_direction: PacketDirection,
state: State
) -> Result<Self, Error>
[src]
s1: TcpStream,
read_direction: PacketDirection,
state: State
) -> Result<Self, Error>
impl CraftConnection<BufReader<OwnedReadHalf>, OwnedWriteHalf>
[src]
pub async fn connect_server_tokio<A>(to: A) -> Result<Self, TokioIoError> where
A: TokioToSocketAddrs,
[src]
A: TokioToSocketAddrs,
impl CraftConnection<OwnedReadHalf, OwnedWriteHalf>
[src]
pub async fn connect_server_tokio_unbuffered<A>(
to: A
) -> Result<Self, TokioIoError> where
A: TokioToSocketAddrs,
[src]
to: A
) -> Result<Self, TokioIoError> where
A: TokioToSocketAddrs,
impl<R, W> CraftConnection<R, W> where
CraftReader<R>: CraftAsyncReader,
CraftWriter<W>: CraftAsyncWriter,
[src]
CraftReader<R>: CraftAsyncReader,
CraftWriter<W>: CraftAsyncWriter,
pub fn from_async(tuple: (R, W), read_direction: PacketDirection) -> Self
[src]
pub fn from_async_with_state(
tuple: (R, W),
read_direction: PacketDirection,
state: State
) -> Self
[src]
tuple: (R, W),
read_direction: PacketDirection,
state: State
) -> Self
Trait Implementations
impl<R, W> CraftAsyncReader for CraftConnection<R, W> where
CraftReader<R>: CraftAsyncReader,
R: Send + Sync,
CraftWriter<W>: CraftAsyncWriter,
W: Send + Sync,
[src]
CraftReader<R>: CraftAsyncReader,
R: Send + Sync,
CraftWriter<W>: CraftAsyncWriter,
W: Send + Sync,
pub fn read_packet_async<'a, 'async_trait, P>(
&'a mut self
) -> Pin<Box<dyn Future<Output = ReadResult<<P as RawPacket<'a>>::Packet>> + Send + 'async_trait>> where
P: RawPacket<'a>,
'a: 'async_trait,
P: 'async_trait,
Self: 'async_trait,
[src]
&'a mut self
) -> Pin<Box<dyn Future<Output = ReadResult<<P as RawPacket<'a>>::Packet>> + Send + 'async_trait>> where
P: RawPacket<'a>,
'a: 'async_trait,
P: 'async_trait,
Self: 'async_trait,
pub fn read_raw_packet_async<'a, 'async_trait, P>(
&'a mut self
) -> Pin<Box<dyn Future<Output = ReadResult<P>> + Send + 'async_trait>> where
P: RawPacket<'a>,
'a: 'async_trait,
P: 'async_trait,
Self: 'async_trait,
[src]
&'a mut self
) -> Pin<Box<dyn Future<Output = ReadResult<P>> + Send + 'async_trait>> where
P: RawPacket<'a>,
'a: 'async_trait,
P: 'async_trait,
Self: 'async_trait,
pub fn read_raw_untyped_packet_async<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = ReadResult<(Id, &[u8])>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = ReadResult<(Id, &[u8])>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
impl<R, W> CraftAsyncWriter for CraftConnection<R, W> where
CraftReader<R>: CraftAsyncReader,
R: Send + Sync,
CraftWriter<W>: CraftAsyncWriter,
W: Send + Sync,
[src]
CraftReader<R>: CraftAsyncReader,
R: Send + Sync,
CraftWriter<W>: CraftAsyncWriter,
W: Send + Sync,
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<R, W> CraftIo for CraftConnection<R, 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<R, W> CraftSyncReader for CraftConnection<R, W> where
CraftReader<R>: CraftSyncReader,
CraftWriter<W>: CraftSyncWriter,
[src]
CraftReader<R>: CraftSyncReader,
CraftWriter<W>: CraftSyncWriter,
pub fn read_packet<'a, P>(
&'a mut self
) -> ReadResult<<P as RawPacket<'a>>::Packet> where
P: RawPacket<'a>,
[src]
&'a mut self
) -> ReadResult<<P as RawPacket<'a>>::Packet> where
P: RawPacket<'a>,
pub fn read_raw_packet<'a, P>(&'a mut self) -> ReadResult<P> where
P: RawPacket<'a>,
[src]
P: RawPacket<'a>,
pub fn read_raw_untyped_packet(&mut self) -> ReadResult<(Id, &[u8])>
[src]
impl<R, W> CraftSyncWriter for CraftConnection<R, W> where
CraftReader<R>: CraftSyncReader,
CraftWriter<W>: CraftSyncWriter,
[src]
CraftReader<R>: CraftSyncReader,
CraftWriter<W>: CraftSyncWriter,
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<R, W> CraftWrapper<(R, W)> for CraftConnection<R, W>
[src]
pub fn into_inner(self) -> (R, W)
[src]
Auto Trait Implementations
impl<R, W> RefUnwindSafe for CraftConnection<R, W> where
R: RefUnwindSafe,
W: RefUnwindSafe,
[src]
R: RefUnwindSafe,
W: RefUnwindSafe,
impl<R, W> Send for CraftConnection<R, W> where
R: Send,
W: Send,
[src]
R: Send,
W: Send,
impl<R, W> Sync for CraftConnection<R, W> where
R: Sync,
W: Sync,
[src]
R: Sync,
W: Sync,
impl<R, W> Unpin for CraftConnection<R, W> where
R: Unpin,
W: Unpin,
[src]
R: Unpin,
W: Unpin,
impl<R, W> UnwindSafe for CraftConnection<R, W> where
R: UnwindSafe,
W: UnwindSafe,
[src]
R: UnwindSafe,
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>,