pub struct Styles {
pub location: Style,
pub bug: Style,
pub error: Style,
pub warning: Style,
pub note: Style,
pub colon: Style,
pub message: Style,
pub snippet: Style,
pub cursor: Style,
}
Expand description
The styles used to render Reports.
Fields§
§location: Style
§bug: Style
§error: Style
§warning: Style
§note: Style
§colon: Style
§message: Style
§snippet: Style
§cursor: Style
Implementations§
Source§impl Styles
impl Styles
Sourcepub const fn styled() -> Self
pub const fn styled() -> Self
Creates a set of Styles with the given styles.
Examples found in repository?
examples/basic.rs (line 5)
3fn main() {
4 let file = File::new("test.txt", "import stds;");
5 let styles = Styles::styled();
6
7 print!(
8 "{}",
9 Renderer::new(
10 &styles,
11 &[
12 error!("Could not find package `{}`", "stds")
13 .location(Location::new(file.clone(), 7)),
14 note!("Perhaps you meant `std`?")
15 ]
16 )
17 );
18}
Trait Implementations§
impl Eq for Styles
impl StructuralPartialEq for Styles
Auto Trait Implementations§
impl Freeze for Styles
impl RefUnwindSafe for Styles
impl Send for Styles
impl Sync for Styles
impl Unpin for Styles
impl UnwindSafe for Styles
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