sedsnet/shared_bytes.rs
1//! Shared wire bytes. The optional arena keeps full-slice views pinned until
2//! exclusive queue parking. Default builds retain the original Arc representation.
3#[cfg(not(feature = "compact-packet-store"))]
4pub type SharedBytes = alloc::sync::Arc<[u8]>;
5#[cfg(feature = "compact-packet-store")]
6pub type SharedBytes = crate::small_payload::SmallPayload<0>;
7
8/// Convert between owned and arena-aware bytes using the destination type.
9/// Keeping this generic supports both directions and the default Arc alias
10/// without feature-dependent identity-conversion lints at each call site.
11#[inline]
12pub(crate) fn convert<T: Into<U>, U>(bytes: T) -> U {
13 bytes.into()
14}