Sha256: f5b23c34b73a716a986fd999fc8d8c9e24c341e83292088fe83325cd82dab4f5
Contents?: true
Size: 718 Bytes
Versions: 38
Compression:
Stored size: 718 Bytes
Contents
use crate::annotation; use crate::parser::{Parse, Parser, Result}; use crate::token::Span; /// A custom section within a component. #[derive(Debug)] pub struct Custom<'a> { /// Where this `@custom` was defined. pub span: Span, /// Name of the custom section. pub name: &'a str, /// Payload of this custom section. pub data: Vec<&'a [u8]>, } impl<'a> Parse<'a> for Custom<'a> { fn parse(parser: Parser<'a>) -> Result<Self> { let span = parser.parse::<annotation::custom>()?.0; let name = parser.parse()?; let mut data = Vec::new(); while !parser.is_empty() { data.push(parser.parse()?); } Ok(Self { span, name, data }) } }
Version data entries
38 entries across 38 versions & 1 rubygems