Struct ezno_parser::ast::BaseSpan
source · pub struct BaseSpan<T>where
T: 'static,{
pub start: u32,
pub end: u32,
pub source: T,
}
Expand description
A start and end. Also contains trace of original source (depending on T
)
Fields§
§start: u32
§end: u32
§source: T
Implementations§
source§impl BaseSpan<()>
impl BaseSpan<()>
sourcepub fn is_adjacent_to(&self, other: impl Into<Start>) -> bool
pub fn is_adjacent_to(&self, other: impl Into<Start>) -> bool
Returns whether the end of self
is the start of other
sourcepub fn union(&self, end: impl Into<End>) -> BaseSpan<()>
pub fn union(&self, end: impl Into<End>) -> BaseSpan<()>
Returns a new Span
which starts at the start of self
a ends at the end of other
pub fn get_end(&self) -> End
pub fn get_start(&self) -> Start
pub fn with_source(self, source: SourceId) -> BaseSpan<SourceId>
source§impl BaseSpan<SourceId>
impl BaseSpan<SourceId>
pub fn get_start(&self) -> Position
pub fn get_end(&self) -> Position
pub fn into_line_column_span<T>(self, fs: &impl FileSystem) -> LineColumnSpan<T>where
T: StringEncoding,
pub fn without_source(self) -> BaseSpan<()>
Trait Implementations§
source§impl<T: ExpressionOrStatementPosition> GetFieldByType<BaseSpan<()>> for ClassDeclaration<T>
impl<T: ExpressionOrStatementPosition> GetFieldByType<BaseSpan<()>> for ClassDeclaration<T>
source§impl GetFieldByType<BaseSpan<()>> for Declaration
impl GetFieldByType<BaseSpan<()>> for Declaration
source§impl GetFieldByType<BaseSpan<()>> for DoWhileStatement
impl GetFieldByType<BaseSpan<()>> for DoWhileStatement
source§impl GetFieldByType<BaseSpan<()>> for ExportDeclaration
impl GetFieldByType<BaseSpan<()>> for ExportDeclaration
source§impl GetFieldByType<BaseSpan<()>> for ExportPart
impl GetFieldByType<BaseSpan<()>> for ExportPart
source§impl GetFieldByType<BaseSpan<()>> for Expression
impl GetFieldByType<BaseSpan<()>> for Expression
source§impl GetFieldByType<BaseSpan<()>> for ForLoopStatement
impl GetFieldByType<BaseSpan<()>> for ForLoopStatement
source§impl<T: FunctionBased> GetFieldByType<BaseSpan<()>> for FunctionBase<T>
impl<T: FunctionBased> GetFieldByType<BaseSpan<()>> for FunctionBase<T>
source§impl GetFieldByType<BaseSpan<()>> for IfStatement
impl GetFieldByType<BaseSpan<()>> for IfStatement
source§impl GetFieldByType<BaseSpan<()>> for ImportDeclaration
impl GetFieldByType<BaseSpan<()>> for ImportDeclaration
source§impl GetFieldByType<BaseSpan<()>> for ImportPart
impl GetFieldByType<BaseSpan<()>> for ImportPart
source§impl GetFieldByType<BaseSpan<()>> for InterfaceDeclaration
impl GetFieldByType<BaseSpan<()>> for InterfaceDeclaration
source§impl GetFieldByType<BaseSpan<()>> for InterfaceMember
impl GetFieldByType<BaseSpan<()>> for InterfaceMember
source§impl GetFieldByType<BaseSpan<()>> for IsExpression
impl GetFieldByType<BaseSpan<()>> for IsExpression
source§impl GetFieldByType<BaseSpan<()>> for JSXElement
impl GetFieldByType<BaseSpan<()>> for JSXElement
source§impl GetFieldByType<BaseSpan<()>> for JSXFragment
impl GetFieldByType<BaseSpan<()>> for JSXFragment
source§impl GetFieldByType<BaseSpan<()>> for MultipleExpression
impl GetFieldByType<BaseSpan<()>> for MultipleExpression
source§impl<T: DestructuringFieldInto> GetFieldByType<BaseSpan<()>> for ObjectDestructuringField<T>
impl<T: DestructuringFieldInto> GetFieldByType<BaseSpan<()>> for ObjectDestructuringField<T>
source§impl GetFieldByType<BaseSpan<()>> for ObjectLiteral
impl GetFieldByType<BaseSpan<()>> for ObjectLiteral
source§impl GetFieldByType<BaseSpan<()>> for ObjectLiteralMember
impl GetFieldByType<BaseSpan<()>> for ObjectLiteralMember
source§impl<T: PropertyKeyKind> GetFieldByType<BaseSpan<()>> for PropertyKey<T>
impl<T: PropertyKeyKind> GetFieldByType<BaseSpan<()>> for PropertyKey<T>
source§impl GetFieldByType<BaseSpan<()>> for ReturnStatement
impl GetFieldByType<BaseSpan<()>> for ReturnStatement
source§impl GetFieldByType<BaseSpan<()>> for StatementOrDeclaration
impl GetFieldByType<BaseSpan<()>> for StatementOrDeclaration
source§impl GetFieldByType<BaseSpan<()>> for SwitchStatement
impl GetFieldByType<BaseSpan<()>> for SwitchStatement
source§impl GetFieldByType<BaseSpan<()>> for TemplateLiteral
impl GetFieldByType<BaseSpan<()>> for TemplateLiteral
source§impl GetFieldByType<BaseSpan<()>> for ThrowStatement
impl GetFieldByType<BaseSpan<()>> for ThrowStatement
source§impl GetFieldByType<BaseSpan<()>> for TryCatchStatement
impl GetFieldByType<BaseSpan<()>> for TryCatchStatement
source§impl GetFieldByType<BaseSpan<()>> for TypeAnnotation
impl GetFieldByType<BaseSpan<()>> for TypeAnnotation
source§impl GetFieldByType<BaseSpan<()>> for VarVariableStatement
impl GetFieldByType<BaseSpan<()>> for VarVariableStatement
source§impl GetFieldByType<BaseSpan<()>> for VariableDeclaration
impl GetFieldByType<BaseSpan<()>> for VariableDeclaration
source§impl<TExpr: DeclarationExpression> GetFieldByType<BaseSpan<()>> for VariableDeclarationItem<TExpr>
impl<TExpr: DeclarationExpression> GetFieldByType<BaseSpan<()>> for VariableDeclarationItem<TExpr>
source§impl GetFieldByType<BaseSpan<()>> for VariableIdentifier
impl GetFieldByType<BaseSpan<()>> for VariableIdentifier
source§impl GetFieldByType<BaseSpan<()>> for VariableOrPropertyAccess
impl GetFieldByType<BaseSpan<()>> for VariableOrPropertyAccess
source§impl GetFieldByType<BaseSpan<()>> for WhileStatement
impl GetFieldByType<BaseSpan<()>> for WhileStatement
source§impl<T> PartialEq for BaseSpan<T>where
T: PartialEq + 'static,
impl<T> PartialEq for BaseSpan<T>where
T: PartialEq + 'static,
source§impl<T> SelfRustTokenize for BaseSpan<T>where
T: 'static + SelfRustTokenize,
impl<T> SelfRustTokenize for BaseSpan<T>where
T: 'static + 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 for BaseSpan<T>where
T: 'static + Serialize,
impl<T> Serialize for BaseSpan<T>where
T: 'static + Serialize,
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T> Copy for BaseSpan<T>where
T: Copy + 'static,
impl<T> Eq for BaseSpan<T>where
T: Eq + 'static,
impl<T> StructuralPartialEq for BaseSpan<T>where
T: 'static,
Auto Trait Implementations§
impl<T> Freeze for BaseSpan<T>where
T: Freeze,
impl<T> RefUnwindSafe for BaseSpan<T>where
T: RefUnwindSafe,
impl<T> Send for BaseSpan<T>where
T: Send,
impl<T> Sync for BaseSpan<T>where
T: Sync,
impl<T> Unpin for BaseSpan<T>where
T: Unpin,
impl<T> UnwindSafe for BaseSpan<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