Struct CustomType

Source
pub struct CustomType {
    pub identifier: Identifier,
    pub scope: Scope,
    pub attributes: Vec<WeakPtr<Attribute>>,
    pub comment: Option<DocComment>,
    pub span: Span,
    /* private fields */
}

Fields§

§identifier: Identifier§scope: Scope§attributes: Vec<WeakPtr<Attribute>>§comment: Option<DocComment>§span: Span

Implementations§

Source§

impl CustomType

Source

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

Visits the CustomType with the provided visitor.

This function delegates to visitor.visit_custom_type.

Trait Implementations§

Source§

impl AsAttributables for CustomType

Source§

impl AsEntities for CustomType

Source§

impl AsTypes for CustomType

Source§

fn concrete_type(&self) -> Types<'_>

Source§

impl Attributable for CustomType

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 Commentable for CustomType

Source§

impl Debug for CustomType

Source§

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

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

impl Element for CustomType

Source§

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

Source§

impl NamedSymbol for CustomType

Source§

impl ScopedSymbol for CustomType

Source§

impl Symbol for CustomType

Source§

fn span(&self) -> &Span

Source§

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

Source§

fn try_from(node: &'a Node) -> Result<&'a CustomType, 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.
Source§

impl Type for CustomType

Source§

impl Entity for CustomType

Auto Trait Implementations§

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.