wtx 0.44.1

A collection of different transport implementations and related tools focused primarily on web technologies.
Documentation
use crate::{
  codec::Encode,
  database::client::mysql::{
    command::Command,
    protocol::{Protocol, encode_wrapper_protocol::EncodeWrapperProtocol},
  },
};

pub(crate) struct QueryReq<'any> {
  pub(crate) query: &'any [u8],
}

impl<E> Encode<Protocol<(), E>> for QueryReq<'_>
where
  E: From<crate::Error>,
{
  #[inline]
  fn encode(&self, ew: &mut EncodeWrapperProtocol<'_>) -> Result<(), E> {
    let _ =
      ew.encode_buffer.extend_from_copyable_slices([&[Command::ComQuery.into()], self.query])?;
    Ok(())
  }
}