Skip to main content

DirectiveNode

Struct DirectiveNode 

Source
pub struct DirectiveNode<'a> {
    pub name: CompactString,
    pub raw_name: Option<CompactString>,
    pub exp: Option<ExpressionNode<'a>>,
    pub arg: Option<ExpressionNode<'a>>,
    pub modifiers: Vec<'a, SimpleExpressionNode<'a>>,
    pub for_parse_result: Option<ForParseResult<'a>>,
    pub shorthand: bool,
    pub loc: SourceLocation,
}
Expand description

Directive node (v-if, v-for, v-bind, etc.)

Fields§

§name: CompactString

Normalized directive name without prefix (e.g., “if”, “for”, “bind”)

§raw_name: Option<CompactString>

Raw attribute name including shorthand (e.g., “@click”, “:class”)

§exp: Option<ExpressionNode<'a>>

Directive expression

§arg: Option<ExpressionNode<'a>>

Directive argument (e.g., “click” in @click)

§modifiers: Vec<'a, SimpleExpressionNode<'a>>

Directive modifiers (e.g., [“stop”, “prevent”] in @click.stop.prevent)

§for_parse_result: Option<ForParseResult<'a>>

Parsed result for v-for

§shorthand: bool

Whether this is a Vue 3.4+ same-name shorthand (:foo without value)

§loc: SourceLocation

Implementations§

Source§

impl<'a> DirectiveNode<'a>

Source

pub fn new( allocator: &'a Bump, name: impl Into<CompactString>, loc: SourceLocation, ) -> DirectiveNode<'a>

Source

pub fn node_type(&self) -> NodeType

Trait Implementations§

Source§

impl<'a> Debug for DirectiveNode<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for DirectiveNode<'a>

§

impl<'a> !RefUnwindSafe for DirectiveNode<'a>

§

impl<'a> !Send for DirectiveNode<'a>

§

impl<'a> !Sync for DirectiveNode<'a>

§

impl<'a> Unpin for DirectiveNode<'a>

§

impl<'a> UnsafeUnpin for DirectiveNode<'a>

§

impl<'a> !UnwindSafe for DirectiveNode<'a>

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<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, 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.