Skip to main content

bel/common/types/
bytes.rs

1use std::any::Any;
2
3use crate::common::{types::Type, value::Val};
4
5pub struct Bytes(Vec<u8>);
6
7impl Val for Bytes {
8    fn get_type(&self) -> Type<'_> {
9        super::BYTES_TYPE
10    }
11
12    fn into_inner(self) -> Box<dyn Any> {
13        Box::new(self.0)
14    }
15}
16
17impl From<Vec<u8>> for Bytes {
18    fn from(value: Vec<u8>) -> Self {
19        Bytes(value)
20    }
21}
22
23impl From<Bytes> for Vec<u8> {
24    fn from(value: Bytes) -> Self {
25        value.0
26    }
27}