pub struct CodeFrameOptions {
pub lines_above: usize,
pub lines_below: usize,
pub color: bool,
pub highlight_code: bool,
pub message: Option<String>,
pub max_width: usize,
pub language: Language,
}Expand description
Options for rendering the code frame
Fields§
§lines_above: usizeNumber of lines to show before the error
lines_below: usizeNumber of lines to show after the error
color: boolWhether to use ANSI color output
highlight_code: boolWhether to attempt syntax highlighting
message: Option<String>Optional message to display with the error
max_width: usizeMaximum width for the output in columns. Callers should set this to
the actual display width (e.g., process.stdout.columns on the JS
side, or a hard-coded value for browser display).
language: LanguageLanguage hint for keyword highlighting
Trait Implementations§
Source§impl Clone for CodeFrameOptions
impl Clone for CodeFrameOptions
Source§fn clone(&self) -> CodeFrameOptions
fn clone(&self) -> CodeFrameOptions
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 CodeFrameOptions
impl Debug for CodeFrameOptions
Source§impl Default for CodeFrameOptions
impl Default for CodeFrameOptions
Source§impl<'de> Deserialize<'de> for CodeFrameOptionswhere
CodeFrameOptions: Default,
impl<'de> Deserialize<'de> for CodeFrameOptionswhere
CodeFrameOptions: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CodeFrameOptions
impl RefUnwindSafe for CodeFrameOptions
impl Send for CodeFrameOptions
impl Sync for CodeFrameOptions
impl Unpin for CodeFrameOptions
impl UnsafeUnpin for CodeFrameOptions
impl UnwindSafe for CodeFrameOptions
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