pub struct BuffedStream<R, W> { /* private fields */ }Expand description
BuffedStream type.
This type is a wrapper around a stream that provides buffering and encryption/decryption functionality. It is used to provide a bincode-centric stream that can be used to send and receive data in a more efficient manner. In order to make usual future splitting more ergonomic, this type is designed to be a wrapper around the split halves.
This type is used to provide a bincode-centric stream that can be used to send and receive data so it is inadvisable to use any other methods than the
pushandpullmethods from the protocol module.
Implementations§
Source§impl<R, W> BuffedStream<R, W>
impl<R, W> BuffedStream<R, W>
Sourcepub fn with_encryption(self, shared_secret: SharedSecret) -> Self
pub fn with_encryption(self, shared_secret: SharedSecret) -> Self
Sets the shared secret for the stream, and enables encryption / decryption.
Source§impl<R, W> BuffedStream<R, W>
impl<R, W> BuffedStream<R, W>
pub fn from_splits(inner_read: R, inner_write: W) -> Self
Source§impl<R> BuffedStream<R, OwnedWriteHalf>
impl<R> BuffedStream<R, OwnedWriteHalf>
pub fn as_inner_tcp_write_ref(&self) -> &OwnedWriteHalf
pub fn as_inner_tcp_write_mut(&mut self) -> &mut OwnedWriteHalf
Source§impl<W> BuffedStream<OwnedReadHalf, W>
impl<W> BuffedStream<OwnedReadHalf, W>
pub fn as_inner_tcp_read_ref(&self) -> &OwnedReadHalf
pub fn as_inner_tcp_read_mut(&mut self) -> &mut OwnedReadHalf
Trait Implementations§
Source§impl<R, W> BincodeReceive for BuffedStream<R, W>
impl<R, W> BincodeReceive for BuffedStream<R, W>
Source§impl<R, W> BincodeSend for BuffedStream<R, W>
impl<R, W> BincodeSend for BuffedStream<R, W>
Source§impl<R, W> BincodeSplit for BuffedStream<R, W>
impl<R, W> BincodeSplit for BuffedStream<R, W>
type ReadHalf = BuffedStreamReadHalf<R>
type WriteHalf = BuffedStreamWriteHalf<W>
Source§impl From<TcpStream> for BuffedStream<OwnedReadHalf, OwnedWriteHalf>
impl From<TcpStream> for BuffedStream<OwnedReadHalf, OwnedWriteHalf>
Auto Trait Implementations§
impl<R, W> Freeze for BuffedStream<R, W>
impl<R, W> RefUnwindSafe for BuffedStream<R, W>where
R: RefUnwindSafe,
W: RefUnwindSafe,
impl<R, W> Send for BuffedStream<R, W>
impl<R, W> Sync for BuffedStream<R, W>
impl<R, W> Unpin for BuffedStream<R, W>
impl<R, W> UnwindSafe for BuffedStream<R, W>where
R: UnwindSafe,
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