pub trait FindMatching {
// Required method
fn find_matching(
&self,
position: usize,
closing: &BTreeMap<&str, &str>,
opening: &BTreeMap<&str, &str>,
) -> usize;
}Expand description
Trait to provide the FindMatching::find_matching method
Required Methods§
Sourcefn find_matching(
&self,
position: usize,
closing: &BTreeMap<&str, &str>,
opening: &BTreeMap<&str, &str>,
) -> usize
fn find_matching( &self, position: usize, closing: &BTreeMap<&str, &str>, opening: &BTreeMap<&str, &str>, ) -> usize
Find the index of the matching open or close grapheme for the grapheme at position, given the
matching closing and opening brackets
If the grapheme at position is not an opening or closing grapheme, position is greater or
equal to the length of self, or the algorithm fails to find the matching grapheme (e.g.
matching graphemes are unbalanced), the given position is returned.
Implementations on Foreign Types§
Source§impl FindMatching for str
impl FindMatching for str
Source§fn find_matching(
&self,
position: usize,
closing: &BTreeMap<&str, &str>,
opening: &BTreeMap<&str, &str>,
) -> usize
fn find_matching( &self, position: usize, closing: &BTreeMap<&str, &str>, opening: &BTreeMap<&str, &str>, ) -> usize
Find the index of the matching open or close grapheme for the grapheme at position, given the
matching closing and opening brackets
If the grapheme at position is not an opening or closing grapheme, position is greater or
equal to the length of self, or the algorithm fails to find the matching grapheme (e.g.
matching graphemes are unbalanced), the given position is returned.
Source§impl FindMatching for GString
impl FindMatching for GString
Source§fn find_matching(
&self,
position: usize,
closing: &BTreeMap<&str, &str>,
opening: &BTreeMap<&str, &str>,
) -> usize
fn find_matching( &self, position: usize, closing: &BTreeMap<&str, &str>, opening: &BTreeMap<&str, &str>, ) -> usize
Find the index of the matching open or close grapheme for the grapheme at position, given the
matching closing and opening brackets
If the grapheme at position is not an opening or closing grapheme, position is greater or
equal to the length of self, or the algorithm fails to find the matching grapheme (e.g.
matching graphemes are unbalanced), the given position is returned.