Struct Module

Source
pub struct Module {
    pub identifier: Identifier,
    pub attributes: Vec<WeakPtr<Attribute>>,
    pub span: Span,
}

Fields§

§identifier: Identifier§attributes: Vec<WeakPtr<Attribute>>§span: Span

Implementations§

Source§

impl Module

Source

pub fn nested_module_identifier(&self) -> &str

If this module was declared using nested module syntax, this returns the entire nested identifier. Otherwise this just returns the module’s identifier.

Source§

impl Module

Source

pub fn visit_with(&self, visitor: &mut impl Visitor)

Visits the Module with the provided visitor.

This function delegates to visitor.visit_module.

Trait Implementations§

Source§

impl AsAttributables for Module

Source§

impl Attributable for Module

Source§

fn attributes(&self) -> Vec<&Attribute>

Returns the attributes of the element.
Source§

fn all_attributes(&self) -> Vec<Vec<&Attribute>>

Returns all the attributes of the element and its parents.
Source§

impl Debug for Module

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Element for Module

Source§

fn kind(&self) -> &'static str

Source§

impl NamedSymbol for Module

Source§

impl Symbol for Module

Source§

fn span(&self) -> &Span

Source§

impl<'a> TryFrom<&'a Node> for &'a Module

Source§

fn try_from(node: &'a Node) -> Result<&'a Module, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

The type returned in the event of a conversion error.

Auto Trait Implementations§

§

impl Freeze for Module

§

impl !RefUnwindSafe for Module

§

impl !Send for Module

§

impl !Sync for Module

§

impl Unpin for Module

§

impl !UnwindSafe for Module

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<A> AttributeFunctions for A
where A: Attributable + ?Sized,

Source§

fn has_attribute<T>(&self) -> bool
where 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,

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§

fn find_attributes<T>(&self) -> Vec<&T>
where T: AttributeKind + 'static,

Returns all the attributes applied to this element that are of the specified type.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.