Struct anitomy_sys::Elements
source · #[repr(C)]pub struct Elements { /* private fields */ }
Expand description
The collection of elements parsed from a filename by Anitomy.
Implementations§
source§impl Elements
impl Elements
sourcepub unsafe fn empty<C: Into<Option<ElementCategory>>>(&self, category: C) -> bool
pub unsafe fn empty<C: Into<Option<ElementCategory>>>(&self, category: C) -> bool
Determines whether there are no elements of a given category.
Passing None
will check for any elements at all.
sourcepub unsafe fn count<C: Into<Option<ElementCategory>>>(
&self,
category: C
) -> usize
pub unsafe fn count<C: Into<Option<ElementCategory>>>(
&self,
category: C
) -> usize
Counts the number of elements of a given category.
Passing None
will count all elements.
sourcepub unsafe fn at(&self, pos: usize) -> Option<Element>
pub unsafe fn at(&self, pos: usize) -> Option<Element>
Get the element at the given position if one exists.
sourcepub unsafe fn get(&self, category: ElementCategory) -> String
pub unsafe fn get(&self, category: ElementCategory) -> String
Gets the first element of a category if one exists, otherwise returns an empty string.
sourcepub unsafe fn get_all(&self, category: ElementCategory) -> Vec<String>
pub unsafe fn get_all(&self, category: ElementCategory) -> Vec<String>
Gets all elements of a category.