Trait unicode_brackets::UnicodeBrackets [] [src]

pub trait UnicodeBrackets {
    fn is_open_bracket(&self) -> bool;
    fn is_close_bracket(&self) -> bool;
    fn to_open_bracket(&self) -> Self;
    fn to_close_bracket(&self) -> Self;
}

Methods for determining whether a character is an opening or closing bracket and for changing the direction of such characters.

The definitions used in this crate are from the unicode bidirectional algorithm (UAX #9). Specifically, see the file http://www.unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt

Required Methods

Determine whether a character is an opening bracket.

Determine whether a character is a closing bracket.

Convert a closing bracket character to an opening bracket. Returns self if the character is not a closing bracket.

Convert an opening bracket character to a closing bracket. Returns self if the character is not an opening bracket.

Implementors