Trait dprint_swc_ext::common::SourceRanged

source ·
pub trait SourceRanged {
Show 18 methods // Required methods fn start(&self) -> SourcePos; fn end(&self) -> SourcePos; // Provided methods fn range(&self) -> SourceRange { ... } fn byte_width(&self) -> usize { ... } fn start_line_fast<'a, P: SourceTextInfoProvider<'a>>( &self, source: P, ) -> usize { ... } fn end_line_fast<'a, P: SourceTextInfoProvider<'a>>( &self, source: P, ) -> usize { ... } fn start_column_fast<'a, P: SourceTextInfoProvider<'a>>( &self, source: P, ) -> usize { ... } fn end_column_fast<'a, P: SourceTextInfoProvider<'a>>( &self, source: P, ) -> usize { ... } fn column_at_pos<'a, P: SourceTextInfoProvider<'a>>( &self, source: P, pos: SourcePos, ) -> usize { ... } fn char_width_fast<'a, P: SourceTextInfoProvider<'a>>( &self, source: P, ) -> usize { ... } fn text_fast<'a, P: SourceTextInfoProvider<'a>>(&self, source: P) -> &'a str { ... } fn tokens_fast<'a>(&self, program: impl RootNode<'a>) -> &'a [TokenAndSpan] { ... } fn leading_comments_fast<'a>( &self, program: impl RootNode<'a>, ) -> CommentsIterator<'a> { ... } fn trailing_comments_fast<'a>( &self, program: impl RootNode<'a>, ) -> CommentsIterator<'a> { ... } fn previous_token_fast<'a>( &self, program: impl RootNode<'a>, ) -> Option<&'a TokenAndSpan> { ... } fn next_token_fast<'a>( &self, program: impl RootNode<'a>, ) -> Option<&'a TokenAndSpan> { ... } fn previous_tokens_fast<'a>( &self, program: impl RootNode<'a>, ) -> &'a [TokenAndSpan] { ... } fn next_tokens_fast<'a>( &self, program: impl RootNode<'a>, ) -> &'a [TokenAndSpan] { ... }
}

Required Methods§

source

fn start(&self) -> SourcePos

source

fn end(&self) -> SourcePos

Provided Methods§

source

fn range(&self) -> SourceRange

source

fn byte_width(&self) -> usize

source

fn start_line_fast<'a, P: SourceTextInfoProvider<'a>>(&self, source: P) -> usize

source

fn end_line_fast<'a, P: SourceTextInfoProvider<'a>>(&self, source: P) -> usize

source

fn start_column_fast<'a, P: SourceTextInfoProvider<'a>>( &self, source: P, ) -> usize

source

fn end_column_fast<'a, P: SourceTextInfoProvider<'a>>(&self, source: P) -> usize

source

fn column_at_pos<'a, P: SourceTextInfoProvider<'a>>( &self, source: P, pos: SourcePos, ) -> usize

source

fn char_width_fast<'a, P: SourceTextInfoProvider<'a>>(&self, source: P) -> usize

source

fn text_fast<'a, P: SourceTextInfoProvider<'a>>(&self, source: P) -> &'a str

source

fn tokens_fast<'a>(&self, program: impl RootNode<'a>) -> &'a [TokenAndSpan]

source

fn leading_comments_fast<'a>( &self, program: impl RootNode<'a>, ) -> CommentsIterator<'a>

source

fn trailing_comments_fast<'a>( &self, program: impl RootNode<'a>, ) -> CommentsIterator<'a>

source

fn previous_token_fast<'a>( &self, program: impl RootNode<'a>, ) -> Option<&'a TokenAndSpan>

source

fn next_token_fast<'a>( &self, program: impl RootNode<'a>, ) -> Option<&'a TokenAndSpan>

source

fn previous_tokens_fast<'a>( &self, program: impl RootNode<'a>, ) -> &'a [TokenAndSpan]

source

fn next_tokens_fast<'a>(&self, program: impl RootNode<'a>) -> &'a [TokenAndSpan]

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, S> SourceRanged for &'a S
where S: ?Sized + SourceRanged + 'a,

source§

fn start(&self) -> SourcePos

source§

fn end(&self) -> SourcePos

Implementors§

source§

impl SourceRanged for SourcePos

source§

impl<'a> SourceRanged for AssignTarget<'a>

source§

impl<'a> SourceRanged for AssignTargetPat<'a>

source§

impl<'a> SourceRanged for BlockStmtOrExpr<'a>

source§

impl<'a> SourceRanged for Callee<'a>

source§

impl<'a> SourceRanged for ClassMember<'a>

source§

impl<'a> SourceRanged for Decl<'a>

source§

impl<'a> SourceRanged for DefaultDecl<'a>

source§

impl<'a> SourceRanged for ExportSpecifier<'a>

source§

impl<'a> SourceRanged for Expr<'a>

source§

impl<'a> SourceRanged for ForHead<'a>

source§

impl<'a> SourceRanged for ImportSpecifier<'a>

source§

impl<'a> SourceRanged for JSXAttrName<'a>

source§

impl<'a> SourceRanged for JSXAttrOrSpread<'a>

source§

impl<'a> SourceRanged for JSXAttrValue<'a>

source§

impl<'a> SourceRanged for JSXElementChild<'a>

source§

impl<'a> SourceRanged for JSXElementName<'a>

source§

impl<'a> SourceRanged for JSXExpr<'a>

source§

impl<'a> SourceRanged for JSXObject<'a>

source§

impl<'a> SourceRanged for Key<'a>

source§

impl<'a> SourceRanged for Lit<'a>

source§

impl<'a> SourceRanged for MemberProp<'a>

source§

impl<'a> SourceRanged for ModuleDecl<'a>

source§

impl<'a> SourceRanged for ModuleExportName<'a>

source§

impl<'a> SourceRanged for ModuleItem<'a>

source§

impl<'a> SourceRanged for Node<'a>

source§

impl<'a> SourceRanged for NodeOrToken<'a>

source§

impl<'a> SourceRanged for ObjectPatProp<'a>

source§

impl<'a> SourceRanged for OptChainBase<'a>

source§

impl<'a> SourceRanged for ParamOrTsParamProp<'a>

source§

impl<'a> SourceRanged for Pat<'a>

source§

impl<'a> SourceRanged for Program<'a>

source§

impl<'a> SourceRanged for ProgramRef<'a>

source§

impl<'a> SourceRanged for Prop<'a>

source§

impl<'a> SourceRanged for PropName<'a>

source§

impl<'a> SourceRanged for PropOrSpread<'a>

source§

impl<'a> SourceRanged for SimpleAssignTarget<'a>

source§

impl<'a> SourceRanged for Stmt<'a>

source§

impl<'a> SourceRanged for SuperProp<'a>

source§

impl<'a> SourceRanged for TsEntityName<'a>

source§

impl<'a> SourceRanged for TsEnumMemberId<'a>

source§

impl<'a> SourceRanged for TsFnOrConstructorType<'a>

source§

impl<'a> SourceRanged for TsFnParam<'a>

source§

impl<'a> SourceRanged for TsLit<'a>

source§

impl<'a> SourceRanged for TsModuleName<'a>

source§

impl<'a> SourceRanged for TsModuleRef<'a>

source§

impl<'a> SourceRanged for TsNamespaceBody<'a>

source§

impl<'a> SourceRanged for TsParamPropParam<'a>

source§

impl<'a> SourceRanged for TsThisTypeOrIdent<'a>

source§

impl<'a> SourceRanged for TsType<'a>

source§

impl<'a> SourceRanged for TsTypeElement<'a>

source§

impl<'a> SourceRanged for TsTypeQueryExpr<'a>

source§

impl<'a> SourceRanged for TsUnionOrIntersectionType<'a>

source§

impl<'a> SourceRanged for VarDeclOrExpr<'a>

source§

impl<'a> SourceRanged for ArrayLit<'a>

source§

impl<'a> SourceRanged for ArrayPat<'a>

source§

impl<'a> SourceRanged for ArrowExpr<'a>

source§

impl<'a> SourceRanged for AssignExpr<'a>

source§

impl<'a> SourceRanged for AssignPat<'a>

source§

impl<'a> SourceRanged for AssignPatProp<'a>

source§

impl<'a> SourceRanged for AssignProp<'a>

source§

impl<'a> SourceRanged for AutoAccessor<'a>

source§

impl<'a> SourceRanged for AwaitExpr<'a>

source§

impl<'a> SourceRanged for BigInt<'a>

source§

impl<'a> SourceRanged for BinExpr<'a>

source§

impl<'a> SourceRanged for BindingIdent<'a>

source§

impl<'a> SourceRanged for BlockStmt<'a>

source§

impl<'a> SourceRanged for Bool<'a>

source§

impl<'a> SourceRanged for BreakStmt<'a>

source§

impl<'a> SourceRanged for CallExpr<'a>

source§

impl<'a> SourceRanged for CatchClause<'a>

source§

impl<'a> SourceRanged for Class<'a>

source§

impl<'a> SourceRanged for ClassDecl<'a>

source§

impl<'a> SourceRanged for ClassExpr<'a>

source§

impl<'a> SourceRanged for ClassMethod<'a>

source§

impl<'a> SourceRanged for ClassProp<'a>

source§

impl<'a> SourceRanged for ComputedPropName<'a>

source§

impl<'a> SourceRanged for CondExpr<'a>

source§

impl<'a> SourceRanged for Constructor<'a>

source§

impl<'a> SourceRanged for ContinueStmt<'a>

source§

impl<'a> SourceRanged for DebuggerStmt<'a>

source§

impl<'a> SourceRanged for Decorator<'a>

source§

impl<'a> SourceRanged for DoWhileStmt<'a>

source§

impl<'a> SourceRanged for EmptyStmt<'a>

source§

impl<'a> SourceRanged for ExportAll<'a>

source§

impl<'a> SourceRanged for ExportDecl<'a>

source§

impl<'a> SourceRanged for ExportDefaultDecl<'a>

source§

impl<'a> SourceRanged for ExportDefaultExpr<'a>

source§

impl<'a> SourceRanged for ExportDefaultSpecifier<'a>

source§

impl<'a> SourceRanged for ExportNamedSpecifier<'a>

source§

impl<'a> SourceRanged for ExportNamespaceSpecifier<'a>

source§

impl<'a> SourceRanged for ExprOrSpread<'a>

source§

impl<'a> SourceRanged for ExprStmt<'a>

source§

impl<'a> SourceRanged for FnDecl<'a>

source§

impl<'a> SourceRanged for FnExpr<'a>

source§

impl<'a> SourceRanged for ForInStmt<'a>

source§

impl<'a> SourceRanged for ForOfStmt<'a>

source§

impl<'a> SourceRanged for ForStmt<'a>

source§

impl<'a> SourceRanged for Function<'a>

source§

impl<'a> SourceRanged for GetterProp<'a>

source§

impl<'a> SourceRanged for Ident<'a>

source§

impl<'a> SourceRanged for IfStmt<'a>

source§

impl<'a> SourceRanged for Import<'a>

source§

impl<'a> SourceRanged for ImportDecl<'a>

source§

impl<'a> SourceRanged for ImportDefaultSpecifier<'a>

source§

impl<'a> SourceRanged for ImportNamedSpecifier<'a>

source§

impl<'a> SourceRanged for ImportStarAsSpecifier<'a>

source§

impl<'a> SourceRanged for Invalid<'a>

source§

impl<'a> SourceRanged for JSXAttr<'a>

source§

impl<'a> SourceRanged for JSXClosingElement<'a>

source§

impl<'a> SourceRanged for JSXClosingFragment<'a>

source§

impl<'a> SourceRanged for JSXElement<'a>

source§

impl<'a> SourceRanged for JSXEmptyExpr<'a>

source§

impl<'a> SourceRanged for JSXExprContainer<'a>

source§

impl<'a> SourceRanged for JSXFragment<'a>

source§

impl<'a> SourceRanged for JSXMemberExpr<'a>

source§

impl<'a> SourceRanged for JSXNamespacedName<'a>

source§

impl<'a> SourceRanged for JSXOpeningElement<'a>

source§

impl<'a> SourceRanged for JSXOpeningFragment<'a>

source§

impl<'a> SourceRanged for JSXSpreadChild<'a>

source§

impl<'a> SourceRanged for JSXText<'a>

source§

impl<'a> SourceRanged for KeyValuePatProp<'a>

source§

impl<'a> SourceRanged for KeyValueProp<'a>

source§

impl<'a> SourceRanged for LabeledStmt<'a>

source§

impl<'a> SourceRanged for MemberExpr<'a>

source§

impl<'a> SourceRanged for MetaPropExpr<'a>

source§

impl<'a> SourceRanged for MethodProp<'a>

source§

impl<'a> SourceRanged for Module<'a>

source§

impl<'a> SourceRanged for NamedExport<'a>

source§

impl<'a> SourceRanged for NewExpr<'a>

source§

impl<'a> SourceRanged for Null<'a>

source§

impl<'a> SourceRanged for Number<'a>

source§

impl<'a> SourceRanged for ObjectLit<'a>

source§

impl<'a> SourceRanged for ObjectPat<'a>

source§

impl<'a> SourceRanged for OptCall<'a>

source§

impl<'a> SourceRanged for OptChainExpr<'a>

source§

impl<'a> SourceRanged for Param<'a>

source§

impl<'a> SourceRanged for ParenExpr<'a>

source§

impl<'a> SourceRanged for PrivateMethod<'a>

source§

impl<'a> SourceRanged for PrivateName<'a>

source§

impl<'a> SourceRanged for PrivateProp<'a>

source§

impl<'a> SourceRanged for Regex<'a>

source§

impl<'a> SourceRanged for RestPat<'a>

source§

impl<'a> SourceRanged for ReturnStmt<'a>

source§

impl<'a> SourceRanged for Script<'a>

source§

impl<'a> SourceRanged for SeqExpr<'a>

source§

impl<'a> SourceRanged for SetterProp<'a>

source§

impl<'a> SourceRanged for SpreadElement<'a>

source§

impl<'a> SourceRanged for StaticBlock<'a>

source§

impl<'a> SourceRanged for Str<'a>

source§

impl<'a> SourceRanged for Super<'a>

source§

impl<'a> SourceRanged for SuperPropExpr<'a>

source§

impl<'a> SourceRanged for SwitchCase<'a>

source§

impl<'a> SourceRanged for SwitchStmt<'a>

source§

impl<'a> SourceRanged for TaggedTpl<'a>

source§

impl<'a> SourceRanged for ThisExpr<'a>

source§

impl<'a> SourceRanged for ThrowStmt<'a>

source§

impl<'a> SourceRanged for Tpl<'a>

source§

impl<'a> SourceRanged for TplElement<'a>

source§

impl<'a> SourceRanged for TryStmt<'a>

source§

impl<'a> SourceRanged for TsArrayType<'a>

source§

impl<'a> SourceRanged for TsAsExpr<'a>

source§

impl<'a> SourceRanged for TsCallSignatureDecl<'a>

source§

impl<'a> SourceRanged for TsConditionalType<'a>

source§

impl<'a> SourceRanged for TsConstAssertion<'a>

source§

impl<'a> SourceRanged for TsConstructSignatureDecl<'a>

source§

impl<'a> SourceRanged for TsConstructorType<'a>

source§

impl<'a> SourceRanged for TsEnumDecl<'a>

source§

impl<'a> SourceRanged for TsEnumMember<'a>

source§

impl<'a> SourceRanged for TsExportAssignment<'a>

source§

impl<'a> SourceRanged for TsExprWithTypeArgs<'a>

source§

impl<'a> SourceRanged for TsExternalModuleRef<'a>

source§

impl<'a> SourceRanged for TsFnType<'a>

source§

impl<'a> SourceRanged for TsGetterSignature<'a>

source§

impl<'a> SourceRanged for TsImportEqualsDecl<'a>

source§

impl<'a> SourceRanged for TsImportType<'a>

source§

impl<'a> SourceRanged for TsIndexSignature<'a>

source§

impl<'a> SourceRanged for TsIndexedAccessType<'a>

source§

impl<'a> SourceRanged for TsInferType<'a>

source§

impl<'a> SourceRanged for TsInstantiation<'a>

source§

impl<'a> SourceRanged for TsInterfaceBody<'a>

source§

impl<'a> SourceRanged for TsInterfaceDecl<'a>

source§

impl<'a> SourceRanged for TsIntersectionType<'a>

source§

impl<'a> SourceRanged for TsKeywordType<'a>

source§

impl<'a> SourceRanged for TsLitType<'a>

source§

impl<'a> SourceRanged for TsMappedType<'a>

source§

impl<'a> SourceRanged for TsMethodSignature<'a>

source§

impl<'a> SourceRanged for TsModuleBlock<'a>

source§

impl<'a> SourceRanged for TsModuleDecl<'a>

source§

impl<'a> SourceRanged for TsNamespaceDecl<'a>

source§

impl<'a> SourceRanged for TsNamespaceExportDecl<'a>

source§

impl<'a> SourceRanged for TsNonNullExpr<'a>

source§

impl<'a> SourceRanged for TsOptionalType<'a>

source§

impl<'a> SourceRanged for TsParamProp<'a>

source§

impl<'a> SourceRanged for TsParenthesizedType<'a>

source§

impl<'a> SourceRanged for TsPropertySignature<'a>

source§

impl<'a> SourceRanged for TsQualifiedName<'a>

source§

impl<'a> SourceRanged for TsRestType<'a>

source§

impl<'a> SourceRanged for TsSatisfiesExpr<'a>

source§

impl<'a> SourceRanged for TsSetterSignature<'a>

source§

impl<'a> SourceRanged for TsThisType<'a>

source§

impl<'a> SourceRanged for TsTplLitType<'a>

source§

impl<'a> SourceRanged for TsTupleElement<'a>

source§

impl<'a> SourceRanged for TsTupleType<'a>

source§

impl<'a> SourceRanged for TsTypeAliasDecl<'a>

source§

impl<'a> SourceRanged for TsTypeAnn<'a>

source§

impl<'a> SourceRanged for TsTypeAssertion<'a>

source§

impl<'a> SourceRanged for TsTypeLit<'a>

source§

impl<'a> SourceRanged for TsTypeOperator<'a>

source§

impl<'a> SourceRanged for TsTypeParam<'a>

source§

impl<'a> SourceRanged for TsTypeParamDecl<'a>

source§

impl<'a> SourceRanged for TsTypeParamInstantiation<'a>

source§

impl<'a> SourceRanged for TsTypePredicate<'a>

source§

impl<'a> SourceRanged for TsTypeQuery<'a>

source§

impl<'a> SourceRanged for TsTypeRef<'a>

source§

impl<'a> SourceRanged for TsUnionType<'a>

source§

impl<'a> SourceRanged for UnaryExpr<'a>

source§

impl<'a> SourceRanged for UpdateExpr<'a>

source§

impl<'a> SourceRanged for UsingDecl<'a>

source§

impl<'a> SourceRanged for VarDecl<'a>

source§

impl<'a> SourceRanged for VarDeclarator<'a>

source§

impl<'a> SourceRanged for WhileStmt<'a>

source§

impl<'a> SourceRanged for WithStmt<'a>

source§

impl<'a> SourceRanged for YieldExpr<'a>

source§

impl<T: Into<SourcePos> + Clone + Copy> SourceRanged for SourceRange<T>