dprint_swc_ext::common

Trait 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: SourceTextProvider<'a>>(&self, source: P) -> usize { ... } fn text_fast<'a, P: SourceTextProvider<'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: SourceTextProvider<'a>>(&self, source: P) -> usize

Source

fn text_fast<'a, P: SourceTextProvider<'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]

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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 IdentName<'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>