Enum ezno_parser::WithComment
source · pub enum WithComment<T> {
None(T),
PrefixComment(String, T, Span),
PostfixComment(T, String, Span),
}
Variants§
Implementations§
source§impl<T> WithComment<T>
impl<T> WithComment<T>
pub fn get_ast(self) -> T
pub fn get_ast_ref(&self) -> &T
pub fn get_ast_mut(&mut self) -> &mut T
pub fn map<U>(self, cb: impl FnOnce(T) -> U) -> WithComment<U>
Trait Implementations§
source§impl<T: ASTNode> ASTNode for WithComment<T>
impl<T: ASTNode> ASTNode for WithComment<T>
fn from_reader( reader: &mut impl TokenReader<TSXToken, TokenStart>, state: &mut ParsingState, options: &ParseOptions ) -> Result<WithComment<T>, ParseError>
source§fn get_position(&self) -> &Span
fn get_position(&self) -> &Span
Returns position of node as span AS IT WAS PARSED. May be Span::NULL if AST was doesn’t match anything in source
fn to_string_from_buffer<U: ToString>( &self, buf: &mut U, options: &ToStringOptions, depth: u8 )
source§fn from_string(
script: String,
options: ParseOptions,
source: SourceId,
offset: Option<u32>
) -> ParseResult<Self>
fn from_string( script: String, options: ParseOptions, source: SourceId, offset: Option<u32> ) -> ParseResult<Self>
From string, with default impl to call abstract method from_reader
source§fn to_string(&self, options: &ToStringOptions) -> String
fn to_string(&self, options: &ToStringOptions) -> String
Returns structure as valid string
source§impl<T: Clone> Clone for WithComment<T>
impl<T: Clone> Clone for WithComment<T>
source§fn clone(&self) -> WithComment<T>
fn clone(&self) -> WithComment<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for WithComment<T>
impl<T: Debug> Debug for WithComment<T>
source§impl<T> From<T> for WithComment<T>
impl<T> From<T> for WithComment<T>
source§impl<T: PartialEq> PartialEq for WithComment<T>
impl<T: PartialEq> PartialEq for WithComment<T>
source§impl<T> SelfRustTokenize for WithComment<T>where
T: SelfRustTokenize,
impl<T> SelfRustTokenize for WithComment<T>where T: SelfRustTokenize,
fn append_to_token_stream(&self, token_stream: &mut TokenStream)
source§fn to_tokens(&self) -> TokenStream
fn to_tokens(&self) -> TokenStream
Returns the tokens used to construct self
source§impl<T: Serialize> Serialize for WithComment<T>
impl<T: Serialize> Serialize for WithComment<T>
source§impl<T: Visitable> Visitable for WithComment<T>
impl<T: Visitable> Visitable for WithComment<T>
fn visit<TData>( &self, visitors: &mut (impl VisitorReceiver<TData> + ?Sized), data: &mut TData, options: &VisitSettings, chain: &mut Annex<'_, Chain> )
fn visit_mut<TData>( &mut self, visitors: &mut (impl VisitorMutReceiver<TData> + ?Sized), data: &mut TData, options: &VisitSettings, chain: &mut Annex<'_, Chain> )
impl<T: Eq> Eq for WithComment<T>
impl<T> StructuralEq for WithComment<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for WithComment<T>where T: RefUnwindSafe,
impl<T> Send for WithComment<T>where T: Send,
impl<T> Sync for WithComment<T>where T: Sync,
impl<T> Unpin for WithComment<T>where T: Unpin,
impl<T> UnwindSafe for WithComment<T>where T: UnwindSafe,
Blanket Implementations§
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