wtx 0.28.0

A collection of different transport implementations and related tools focused primarily on web technologies.
use crate::misc::{Lease, Vector};

/// Struct used for encoding elements in MySQL.
#[derive(Debug)]
pub struct EncodeWrapper<'any> {
  pub(crate) vector: &'any mut Vector<u8>,
}

impl<'any> EncodeWrapper<'any> {
  /// New instance
  #[inline]
  pub const fn new(vector: &'any mut Vector<u8>) -> Self {
    Self { vector }
  }
}

impl Lease<[u8]> for EncodeWrapper<'_> {
  #[inline]
  fn lease(&self) -> &[u8] {
    self.vector
  }
}