pub struct SliceFile {
pub filename: String,
pub relative_path: String,
pub raw_text: String,
pub module: Option<WeakPtr<Module>>,
pub attributes: Vec<WeakPtr<Attribute>>,
pub contents: Vec<Definition>,
pub is_source: bool,
}Fields§
§filename: String§relative_path: String§raw_text: String§module: Option<WeakPtr<Module>>§attributes: Vec<WeakPtr<Attribute>>§contents: Vec<Definition>§is_source: boolImplementations§
Source§impl SliceFile
impl SliceFile
Sourcepub fn visit_with(&self, visitor: &mut impl Visitor)
pub fn visit_with(&self, visitor: &mut impl Visitor)
Visits the SliceFile with the provided visitor.
This function first calls visitor.visit_file, then if the file contains a module declaration it calls
visitor.visit_module, and finally it recursively visits any definitions defined in the file.
Trait Implementations§
Source§impl AsAttributables for SliceFile
impl AsAttributables for SliceFile
fn concrete_attributable(&self) -> Attributables<'_>
Source§impl Attributable for SliceFile
impl Attributable for SliceFile
Source§fn attributes(&self) -> Vec<&Attribute>
fn attributes(&self) -> Vec<&Attribute>
Returns the attributes of the element.
Source§fn all_attributes(&self) -> Vec<&Attribute>
fn all_attributes(&self) -> Vec<&Attribute>
Returns all the attributes of the element and its parents.
Auto Trait Implementations§
impl Freeze for SliceFile
impl !RefUnwindSafe for SliceFile
impl !Send for SliceFile
impl !Sync for SliceFile
impl Unpin for SliceFile
impl UnsafeUnpin for SliceFile
impl !UnwindSafe for SliceFile
Blanket Implementations§
Source§impl<A> AttributeFunctions for Awhere
A: Attributable + ?Sized,
impl<A> AttributeFunctions for Awhere
A: Attributable + ?Sized,
Source§fn has_attribute<T>(&self) -> boolwhere
T: AttributeKind + 'static,
fn has_attribute<T>(&self) -> boolwhere
T: AttributeKind + 'static,
Returns true if this element has an attribute of the specified type and false otherwise.
Source§fn find_attribute<T>(&self) -> Option<&T>where
T: AttributeKind + 'static,
fn find_attribute<T>(&self) -> Option<&T>where
T: AttributeKind + 'static,
Returns the first attribute of the specified type that is applied to this element.
If no attributes of the specified type can be found, this returns
None.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