pub struct SyntaxMapping { /* private fields */ }
Implementations§
source§impl SyntaxMapping
impl SyntaxMapping
pub fn new() -> Self
sourcepub fn upmap_child_element(
&self,
child: &SyntaxElement,
input_ancestor: &SyntaxNode,
output_ancestor: &SyntaxNode,
) -> Result<SyntaxElement, MissingMapping>
pub 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 fn upmap_child(
&self,
child: &SyntaxNode,
input_ancestor: &SyntaxNode,
output_ancestor: &SyntaxNode,
) -> Result<SyntaxNode, MissingMapping>
pub 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.
pub fn upmap_element( &self, input: &SyntaxElement, output_root: &SyntaxNode, ) -> Option<Result<SyntaxElement, MissingMapping>>
pub fn upmap_node( &self, input: &SyntaxNode, output_root: &SyntaxNode, ) -> Option<Result<SyntaxNode, MissingMapping>>
pub fn merge(&mut self, other: SyntaxMapping)
pub fn add_mapping(&mut self, syntax_mapping: SyntaxMappingBuilder)
Trait Implementations§
source§impl Debug for SyntaxMapping
impl Debug for SyntaxMapping
source§impl Default for SyntaxMapping
impl Default for SyntaxMapping
source§fn default() -> SyntaxMapping
fn default() -> SyntaxMapping
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SyntaxMapping
impl !RefUnwindSafe for SyntaxMapping
impl !Send for SyntaxMapping
impl !Sync for SyntaxMapping
impl Unpin for SyntaxMapping
impl !UnwindSafe 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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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