Enum glsl_lang_pp::processor::event::Event

source ·
pub enum Event {
    Error {
        error: Error,
        masked: bool,
    },
    EnterFile {
        file_id: FileId,
        path: PathBuf,
        canonical_path: PathBuf,
    },
    Token {
        token: OutputToken,
        masked: bool,
    },
    Directive {
        directive: EventDirective,
        masked: bool,
    },
}

Variants§

§

Error

Fields

§error: Error
§masked: bool
§

EnterFile

Fields

§file_id: FileId
§path: PathBuf
§canonical_path: PathBuf
§

Token

Fields

§masked: bool
§

Directive

Fields

§directive: EventDirective
§masked: bool

Implementations§

source§

impl Event

source

pub fn enter_file(file_id: FileId) -> Self

source

pub fn token<T: TokenLike>(token: T, masked: bool) -> Self

source

pub fn directive<D: Into<DirectiveKind>>(d: Directive<D>, masked: bool) -> Self

source

pub fn directive_errors<D: Into<DirectiveKind>>( d: Directive<D>, masked: bool, errors: impl IntoIterator<Item = impl Into<ErrorKind>>, location: &ExpandLocation, ) -> Self

source

pub fn directive_error<E: Into<ProcessingErrorKind>>( (error, node): (E, SyntaxNode<PreprocessorLang>), location: &ExpandLocation, masked: bool, ) -> Self

source

pub fn error<T: Into<ErrorKind>>( e: T, pos: impl Into<TextRange>, location: &ExpandLocation, masked: bool, ) -> Self

source

pub fn map_error<T: Into<ErrorKind>>(e: Located<T>, masked: bool) -> Self

source

pub fn is_token(&self) -> bool

source

pub fn as_token(&self) -> Option<&OutputToken>

source

pub fn into_token(self) -> Option<OutputToken>

Trait Implementations§

source§

impl Debug for Event

source§

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

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

impl From<(EventDirective, bool)> for Event

source§

fn from(value: (EventDirective, bool)) -> Self

Converts to this type from the input type.
source§

impl From<(FileId, PathBuf, PathBuf)> for Event

source§

fn from(value: (FileId, PathBuf, PathBuf)) -> Self

Converts to this type from the input type.
source§

impl From<(Located<ErrorKind>, bool)> for Event

source§

fn from(value: (Error, bool)) -> Self

Converts to this type from the input type.
source§

impl From<(OutputToken, bool)> for Event

source§

fn from(value: (OutputToken, bool)) -> Self

Converts to this type from the input type.
source§

impl From<Event> for ExpandEvent

source§

fn from(event: Event) -> Self

Converts to this type from the input type.
source§

impl From<Event> for HandleNodeResult

source§

fn from(value: Event) -> Self

Converts to this type from the input type.
source§

impl From<Event> for SendEvent

source§

fn from(value: Event) -> Self

Converts to this type from the input type.
source§

impl From<OutputToken> for Event

source§

fn from(token: OutputToken) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Event

source§

fn eq(&self, other: &Event) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Event

source§

impl StructuralPartialEq for Event

Auto Trait Implementations§

§

impl Freeze for Event

§

impl !RefUnwindSafe for Event

§

impl !Send for Event

§

impl !Sync for Event

§

impl Unpin for Event

§

impl !UnwindSafe for Event

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

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

§

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

§

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.