use crate::{ComponentSection, ComponentSectionId, Encode};
#[derive(Clone, Debug)]
pub struct ComponentStartSection<A> {
pub function_index: u32,
pub args: A,
}
impl<A> Encode for ComponentStartSection<A>
where
A: AsRef<[u32]>,
{
fn encode(&self, sink: &mut Vec<u8>) {
let mut bytes = Vec::new();
self.function_index.encode(&mut bytes);
self.args.as_ref().encode(&mut bytes);
ComponentSectionId::Start.encode(sink);
bytes.encode(sink);
}
}
impl<A> ComponentSection for ComponentStartSection<A> where A: AsRef<[u32]> {}