wtx 0.44.3

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

pub(crate) struct EncodeWrapperProtocol<'any> {
  pub(crate) capabilities: &'any mut u64,
  pub(crate) encode_buffer: &'any mut Vector<u8>,
}

impl<'any> EncodeWrapperProtocol<'any> {
  pub(crate) const fn new(
    capabilities: &'any mut u64,
    encode_buffer: &'any mut Vector<u8>,
  ) -> Self {
    Self { capabilities, encode_buffer }
  }
}

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