Type Alias InFile
pub type InFile<T> = InFileWrapper<HirFileId, T>;
Aliased Type§
struct InFile<T> {
pub file_id: HirFileId,
pub value: T,
}
Fields§
§file_id: HirFileId
§value: T
Implementations
§impl<FileId, N> InFileWrapper<FileId, &N>where
FileId: Copy,
N: AstNode,
impl<FileId, N> InFileWrapper<FileId, &N>where
FileId: Copy,
N: AstNode,
pub fn syntax_ref(&self) -> InFileWrapper<FileId, &SyntaxNode<RustLanguage>>
§impl<FileId, N> InFileWrapper<FileId, AstPtr<N>>where
FileId: FileIdToSyntax,
N: AstNode,
impl<FileId, N> InFileWrapper<FileId, AstPtr<N>>where
FileId: FileIdToSyntax,
N: AstNode,
pub fn to_node(&self, db: &(dyn ExpandDatabase + 'static)) -> N
§impl<FileId, N> InFileWrapper<FileId, N>where
FileId: Copy,
N: AstNode,
impl<FileId, N> InFileWrapper<FileId, N>where
FileId: Copy,
N: AstNode,
pub fn syntax(&self) -> InFileWrapper<FileId, &SyntaxNode<RustLanguage>>
§impl<FileId, T> InFileWrapper<FileId, T>where
FileId: FileIdToSyntax,
impl<FileId, T> InFileWrapper<FileId, T>where
FileId: FileIdToSyntax,
pub fn file_syntax( &self, db: &(dyn ExpandDatabase + 'static), ) -> SyntaxNode<RustLanguage>
§impl<FileKind, T> InFileWrapper<FileKind, &T>
impl<FileKind, T> InFileWrapper<FileKind, &T>
pub fn cloned(&self) -> InFileWrapper<FileKind, T>
§impl<FileKind, L, R> InFileWrapper<FileKind, Either<L, R>>
impl<FileKind, L, R> InFileWrapper<FileKind, Either<L, R>>
pub fn transpose( self, ) -> Either<InFileWrapper<FileKind, L>, InFileWrapper<FileKind, R>>
§impl<FileKind, T> InFileWrapper<FileKind, Option<T>>
impl<FileKind, T> InFileWrapper<FileKind, Option<T>>
pub fn transpose(self) -> Option<InFileWrapper<FileKind, T>>
§impl<FileKind, T> InFileWrapper<FileKind, T>
impl<FileKind, T> InFileWrapper<FileKind, T>
pub fn new(file_id: FileKind, value: T) -> InFileWrapper<FileKind, T>
pub fn map<F, U>(self, f: F) -> InFileWrapper<FileKind, U>where
F: FnOnce(T) -> U,
§impl<FileKind, T> InFileWrapper<FileKind, T>where
FileKind: Copy,
impl<FileKind, T> InFileWrapper<FileKind, T>where
FileKind: Copy,
pub fn with_value<U>(&self, value: U) -> InFileWrapper<FileKind, U>
pub fn as_ref(&self) -> InFileWrapper<FileKind, &T>
pub fn borrow<U>(&self) -> InFileWrapper<FileKind, &U>where
T: Borrow<U>,
§impl InFileWrapper<HirFileId, &SyntaxNode<RustLanguage>>
impl InFileWrapper<HirFileId, &SyntaxNode<RustLanguage>>
pub fn original_file_range_opt(
self,
db: &(dyn ExpandDatabase + 'static),
) -> Option<(FileRangeWrapper<EditionedFileId>, SyntaxContext)>
pub fn original_file_range_opt( self, db: &(dyn ExpandDatabase + 'static), ) -> Option<(FileRangeWrapper<EditionedFileId>, SyntaxContext)>
Attempts to map the syntax node back up its macro calls.
§impl InFileWrapper<HirFileId, ErasedFileAstId>
impl InFileWrapper<HirFileId, ErasedFileAstId>
pub fn to_range(&self, db: &(dyn ExpandDatabase + 'static)) -> TextRange
pub fn to_ptr( &self, db: &(dyn ExpandDatabase + 'static), ) -> SyntaxNodePtr<RustLanguage>
§impl<N> InFileWrapper<HirFileId, FileAstId<N>>where
N: AstIdNode,
impl<N> InFileWrapper<HirFileId, FileAstId<N>>where
N: AstIdNode,
pub fn to_node(&self, db: &(dyn ExpandDatabase + 'static)) -> N
pub fn to_range(&self, db: &(dyn ExpandDatabase + 'static)) -> TextRange
pub fn to_in_file_node( &self, db: &(dyn ExpandDatabase + 'static), ) -> InFileWrapper<HirFileId, N>
pub fn to_ptr(&self, db: &(dyn ExpandDatabase + 'static)) -> AstPtr<N>
§impl<N> InFileWrapper<HirFileId, N>where
N: AstNode,
impl<N> InFileWrapper<HirFileId, N>where
N: AstNode,
pub fn original_ast_node_rooted( self, db: &(dyn ExpandDatabase + 'static), ) -> Option<InFileWrapper<EditionedFileId, N>>
§impl<SN> InFileWrapper<HirFileId, SN>where
SN: Borrow<SyntaxNode<RustLanguage>>,
impl<SN> InFileWrapper<HirFileId, SN>where
SN: Borrow<SyntaxNode<RustLanguage>>,
pub fn parent_ancestors_with_macros( self, db: &(dyn ExpandDatabase + 'static), ) -> impl Iterator<Item = InFileWrapper<HirFileId, SyntaxNode<RustLanguage>>>
pub fn ancestors_with_macros( self, db: &(dyn ExpandDatabase + 'static), ) -> impl Iterator<Item = InFileWrapper<HirFileId, SyntaxNode<RustLanguage>>>
pub fn kind(&self) -> SyntaxKind
pub fn text_range(&self) -> TextRange
pub fn original_file_range_rooted(
self,
db: &(dyn ExpandDatabase + 'static),
) -> FileRangeWrapper<EditionedFileId>
pub fn original_file_range_rooted( self, db: &(dyn ExpandDatabase + 'static), ) -> FileRangeWrapper<EditionedFileId>
Falls back to the macro call range if the node cannot be mapped up fully.
For attributes and derives, this will point back to the attribute only.
For the entire item use [InFile::original_file_range_full
].
pub fn original_file_range_with_macro_call_body(
self,
db: &(dyn ExpandDatabase + 'static),
) -> FileRangeWrapper<EditionedFileId>
pub fn original_file_range_with_macro_call_body( self, db: &(dyn ExpandDatabase + 'static), ) -> FileRangeWrapper<EditionedFileId>
Falls back to the macro call range if the node cannot be mapped up fully.
pub fn original_syntax_node_rooted( self, db: &(dyn ExpandDatabase + 'static), ) -> Option<InFileWrapper<EditionedFileId, SyntaxNode<RustLanguage>>>
§impl InFileWrapper<HirFileId, SyntaxToken<RustLanguage>>
impl InFileWrapper<HirFileId, SyntaxToken<RustLanguage>>
pub fn original_file_range(
self,
db: &(dyn ExpandDatabase + 'static),
) -> FileRangeWrapper<EditionedFileId>
pub fn original_file_range( self, db: &(dyn ExpandDatabase + 'static), ) -> FileRangeWrapper<EditionedFileId>
Falls back to the macro call range if the node cannot be mapped up fully.
pub fn original_file_range_opt(
self,
db: &(dyn ExpandDatabase + 'static),
) -> Option<FileRangeWrapper<EditionedFileId>>
pub fn original_file_range_opt( self, db: &(dyn ExpandDatabase + 'static), ) -> Option<FileRangeWrapper<EditionedFileId>>
Attempts to map the syntax node back up its macro calls.
§impl<T> InFileWrapper<HirFileId, T>
impl<T> InFileWrapper<HirFileId, T>
pub fn into_real_file( self, ) -> Result<InFileWrapper<EditionedFileId, T>, InFileWrapper<HirFileId, T>>
§impl InFileWrapper<HirFileId, TextRange>
impl InFileWrapper<HirFileId, TextRange>
pub fn original_node_file_range( self, db: &(dyn ExpandDatabase + 'static), ) -> (FileRangeWrapper<EditionedFileId>, SyntaxContext)
pub fn original_node_file_range_rooted( self, db: &(dyn ExpandDatabase + 'static), ) -> FileRangeWrapper<EditionedFileId>
pub fn original_node_file_range_with_macro_call_body( self, db: &(dyn ExpandDatabase + 'static), ) -> FileRangeWrapper<EditionedFileId>
pub fn original_node_file_range_opt( self, db: &(dyn ExpandDatabase + 'static), ) -> Option<(FileRangeWrapper<EditionedFileId>, SyntaxContext)>
Trait Implementations
§impl AsMacroCall for InFileWrapper<HirFileId, &MacroCall>
impl AsMacroCall for InFileWrapper<HirFileId, &MacroCall>
fn as_call_id_with_errors( &self, db: &(dyn ExpandDatabase + 'static), krate: Crate, resolver: impl Fn(&ModPath) -> Option<MacroDefId> + Copy, ) -> Result<ValueResult<Option<MacroCallId>, ExpandError>, UnresolvedMacro>
fn as_call_id( &self, db: &(dyn ExpandDatabase + 'static), krate: Crate, resolver: impl Fn(&ModPath) -> Option<MacroDefId> + Copy, ) -> Option<MacroCallId>
§impl<FileKind, T> Clone for InFileWrapper<FileKind, T>
impl<FileKind, T> Clone for InFileWrapper<FileKind, T>
§fn clone(&self) -> InFileWrapper<FileKind, T>
fn clone(&self) -> InFileWrapper<FileKind, 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 more§impl<FileKind, T> Debug for InFileWrapper<FileKind, T>
impl<FileKind, T> Debug for InFileWrapper<FileKind, T>
§impl<T> From<InFileWrapper<EditionedFileId, T>> for InFileWrapper<HirFileId, T>
impl<T> From<InFileWrapper<EditionedFileId, T>> for InFileWrapper<HirFileId, T>
§fn from(_: InFileWrapper<EditionedFileId, T>) -> InFileWrapper<HirFileId, T>
fn from(_: InFileWrapper<EditionedFileId, T>) -> InFileWrapper<HirFileId, T>
Converts to this type from the input type.
§impl<T> From<InFileWrapper<MacroFileId, T>> for InFileWrapper<HirFileId, T>
impl<T> From<InFileWrapper<MacroFileId, T>> for InFileWrapper<HirFileId, T>
§fn from(_: InFileWrapper<MacroFileId, T>) -> InFileWrapper<HirFileId, T>
fn from(_: InFileWrapper<MacroFileId, T>) -> InFileWrapper<HirFileId, T>
Converts to this type from the input type.