use crate::{Encode, Section};
use alloc::vec::Vec;
#[derive(Clone, Copy, Debug)]
pub struct RawSection<'a> {
pub id: u8,
pub data: &'a [u8],
}
impl Encode for RawSection<'_> {
fn encode(&self, sink: &mut Vec<u8>) {
self.data.encode(sink);
}
}
impl Section for RawSection<'_> {
fn id(&self) -> u8 {
self.id
}
}
#[cfg(feature = "component-model")]
impl crate::ComponentSection for RawSection<'_> {
fn id(&self) -> u8 {
self.id
}
}