pub struct MySyncFramed<T> { /* private fields */ }Expand description
Synchronous framed stream for MySql protocol.
This type is a synchronous alternative to tokio_codec::Framed.
Implementations§
Source§impl<T> MySyncFramed<T>
impl<T> MySyncFramed<T>
Sourcepub fn codec(&self) -> &PacketCodec
pub fn codec(&self) -> &PacketCodec
Returns reference to a codec.
Sourcepub fn codec_mut(&mut self) -> &mut PacketCodec
pub fn codec_mut(&mut self) -> &mut PacketCodec
Returns mutable reference to a codec.
Sourcepub fn destruct(self) -> (BytesMut, BytesMut, PacketCodec, T)
pub fn destruct(self) -> (BytesMut, BytesMut, PacketCodec, T)
Consumes self and returns wrapped buffers, codec and stream.
Sourcepub fn construct(
in_buf: BytesMut,
out_buf: BytesMut,
codec: PacketCodec,
stream: T,
) -> Self
pub fn construct( in_buf: BytesMut, out_buf: BytesMut, codec: PacketCodec, stream: T, ) -> Self
Creates new instance from given buffers, codec and stream.
Source§impl<T> MySyncFramed<T>where
T: Write,
impl<T> MySyncFramed<T>where
T: Write,
Source§impl<T> MySyncFramed<T>where
T: Read,
impl<T> MySyncFramed<T>where
T: Read,
Sourcepub fn next_packet<U>(&mut self, dst: &mut U) -> Result<bool, PacketCodecError>
pub fn next_packet<U>(&mut self, dst: &mut U) -> Result<bool, PacketCodecError>
Returns true if dst contains the next packet.
false means, that the dst is empty and the stream is at eof.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for MySyncFramed<T>where
T: Freeze,
impl<T> RefUnwindSafe for MySyncFramed<T>where
T: RefUnwindSafe,
impl<T> Send for MySyncFramed<T>where
T: Send,
impl<T> Sync for MySyncFramed<T>where
T: Sync,
impl<T> Unpin for MySyncFramed<T>where
T: Unpin,
impl<T> UnwindSafe for MySyncFramed<T>where
T: 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