pub struct ParseNodeEnclose {
pub mode: Mode,
pub loc: Option<SourceLocation>,
pub label: String,
pub background_color: Option<String>,
pub border_color: Option<String>,
pub body: Box<AnyParseNode>,
}
Expand description
Represents enclosed mathematical expressions with background and border styling.
This struct handles expressions that are enclosed with colored backgrounds or borders, often used for highlighting or special notation.
§Fields
mode
- The parsing mode (Mode::Math
orMode::Text
)loc
- Optional source location for error reportinglabel
- The enclosure type/labelbackground_color
- Optional background colorborder_color
- Optional border colorbody
- The enclosed expression
§LaTeX Correspondence
Corresponds to LaTeX enclosure commands:
\boxed{x} % Boxed
\colorbox{yellow}{x} % Background color
\fcolorbox{red}{blue}{x} % Border and background
§Usage
Enclose nodes provide visual emphasis and grouping for mathematical expressions, useful for highlighting important terms or creating visual distinctions.
Fields§
§mode: Mode
The parsing mode (Mode::Math
or Mode::Text
)
loc: Option<SourceLocation>
Optional source location for error reporting
label: String
The enclosure type/label
background_color: Option<String>
Optional background color
border_color: Option<String>
Optional border color
body: Box<AnyParseNode>
The enclosed expression
Trait Implementations§
Source§impl Clone for ParseNodeEnclose
impl Clone for ParseNodeEnclose
Source§fn clone(&self) -> ParseNodeEnclose
fn clone(&self) -> ParseNodeEnclose
Returns a duplicate 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 moreSource§impl Debug for ParseNodeEnclose
impl Debug for ParseNodeEnclose
Source§impl PartialEq for ParseNodeEnclose
impl PartialEq for ParseNodeEnclose
impl StructuralPartialEq for ParseNodeEnclose
Auto Trait Implementations§
impl Freeze for ParseNodeEnclose
impl RefUnwindSafe for ParseNodeEnclose
impl Send for ParseNodeEnclose
impl Sync for ParseNodeEnclose
impl Unpin for ParseNodeEnclose
impl UnwindSafe for ParseNodeEnclose
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