wtx 0.44.3

A collection of different transport implementations and related tools focused primarily on web technologies.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// Used in operations that expand collections.
#[derive(Clone, Copy, Debug)]
pub enum ExpansionTy {
  /// Buffer should be modified with more elements
  Additional(usize),
  /// Buffer should be modified using the exact specified length.
  Len(usize),
}

impl ExpansionTy {
  pub(crate) fn params(self, len: usize) -> Option<(usize, usize)> {
    Some(match self {
      Self::Additional(elem) => (elem, len.checked_add(elem)?),
      Self::Len(elem) => (elem.checked_sub(len)?, elem),
    })
  }
}