binn_rs/allocation.rs
1/// Represents memory where binn data will be stored
2#[non_exhaustive]
3#[derive(Debug)]
4pub enum Allocation<'a> {
5 /// Represents static allocation that can't be changed in size
6 /// and will be valid for a lifetime *'a*
7 Static(&'a mut [u8]),
8}
9
10impl<'a> From<&'a mut [u8]> for Allocation<'a> {
11 fn from(value: &'a mut [u8]) -> Self {
12 Allocation::Static(value)
13 }
14}