pub struct SyntaxMapping {
entry_parents: Vec<SyntaxNode>,
node_mappings: FxHashMap<SyntaxNode, MappingEntry>,
}Fields§
§entry_parents: Vec<SyntaxNode>§node_mappings: FxHashMap<SyntaxNode, MappingEntry>Implementations§
Source§impl SyntaxMapping
impl SyntaxMapping
Sourcepub(super) fn upmap_child_element(
&self,
child: &SyntaxElement,
input_ancestor: &SyntaxNode,
output_ancestor: &SyntaxNode,
) -> Result<SyntaxElement, MissingMapping>
pub(super) fn upmap_child_element( &self, child: &SyntaxElement, input_ancestor: &SyntaxNode, output_ancestor: &SyntaxNode, ) -> Result<SyntaxElement, MissingMapping>
Like SyntaxMapping::upmap_child but for syntax elements.
Sourcepub(super) fn upmap_child(
&self,
child: &SyntaxNode,
input_ancestor: &SyntaxNode,
output_ancestor: &SyntaxNode,
) -> Result<SyntaxNode, MissingMapping>
pub(super) fn upmap_child( &self, child: &SyntaxNode, input_ancestor: &SyntaxNode, output_ancestor: &SyntaxNode, ) -> Result<SyntaxNode, MissingMapping>
Maps a child node of the input ancestor to the corresponding node in the output ancestor.
fn upmap_to_ancestor( &self, input_ancestor: &SyntaxNode, output_ancestor: &SyntaxNode, ) -> Result<Vec<usize>, MissingMapping>
pub(super) fn upmap_element(&self, input: &SyntaxElement) -> SyntaxElement
pub fn merge(&mut self, other: SyntaxMapping)
Sourcefn upmap_node_single(&self, input: &SyntaxNode) -> Option<SyntaxNode>
fn upmap_node_single(&self, input: &SyntaxNode) -> Option<SyntaxNode>
Follows the input one step along the syntax mapping tree
pub fn add_mapping(&mut self, syntax_mapping: SyntaxMappingBuilder)
Trait Implementations§
Source§impl Debug for SyntaxMapping
impl Debug for SyntaxMapping
Auto Trait Implementations§
impl !RefUnwindSafe for SyntaxMapping
impl !Send for SyntaxMapping
impl !Sync for SyntaxMapping
impl !UnwindSafe for SyntaxMapping
impl Freeze for SyntaxMapping
impl Unpin for SyntaxMapping
impl UnsafeUnpin for SyntaxMapping
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more