pub struct ArtDescriptor<'a> {
pub filename: &'a str,
pub source: &'a str,
pub metadata: ArtMetadata<'a>,
pub variants: Vec<'a, ArtVariant<'a>>,
pub script_setup: Option<ArtScriptBlock<'a>>,
pub script: Option<ArtScriptBlock<'a>>,
pub styles: Vec<'a, ArtStyleBlock<'a>>,
}Expand description
Parsed Art file descriptor.
Uses arena allocation for all collections. String data is borrowed directly from source.
Fields§
§filename: &'a strSource filename
source: &'a strOriginal source code (borrowed)
metadata: ArtMetadata<'a>Art metadata from <art> block attributes
variants: Vec<'a, ArtVariant<'a>>Variant definitions from <variant> blocks (arena-allocated)
script_setup: Option<ArtScriptBlock<'a>>Script setup block (if present)
script: Option<ArtScriptBlock<'a>>Regular script block (if present)
styles: Vec<'a, ArtStyleBlock<'a>>Style blocks (arena-allocated)
Implementations§
Source§impl<'a> ArtDescriptor<'a>
impl<'a> ArtDescriptor<'a>
Sourcepub fn new(allocator: &'a Bump, filename: &'a str, source: &'a str) -> Self
pub fn new(allocator: &'a Bump, filename: &'a str, source: &'a str) -> Self
Create a new descriptor with arena allocation.
Sourcepub fn default_variant(&self) -> Option<&ArtVariant<'a>>
pub fn default_variant(&self) -> Option<&ArtVariant<'a>>
Get the default variant, or the first one if none is marked default.
Source§impl<'a> ArtDescriptor<'a>
impl<'a> ArtDescriptor<'a>
Sourcepub fn into_owned(self) -> ArtDescriptorOwned
pub fn into_owned(self) -> ArtDescriptorOwned
Convert to owned version for serialization.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ArtDescriptor<'a>
impl<'a> !RefUnwindSafe for ArtDescriptor<'a>
impl<'a> !Send for ArtDescriptor<'a>
impl<'a> !Sync for ArtDescriptor<'a>
impl<'a> Unpin for ArtDescriptor<'a>
impl<'a> UnsafeUnpin for ArtDescriptor<'a>
impl<'a> !UnwindSafe for ArtDescriptor<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more