pub struct Traceback { /* private fields */ }Expand description
Renders a traceback with Rich formatting.
Mimics Python Rich’s rich.traceback.Traceback renderable.
Implementations§
Source§impl Traceback
impl Traceback
Sourcepub fn from_exception(
exc_type: impl Into<String>,
exc_value: impl Into<String>,
frames: Vec<Frame>,
) -> Self
pub fn from_exception( exc_type: impl Into<String>, exc_value: impl Into<String>, frames: Vec<Frame>, ) -> Self
Convenience constructor: build a Traceback from an exception type,
value, and list of frames.
pub fn width(self, width: usize) -> Self
pub fn code_width(self, width: usize) -> Self
pub fn extra_lines(self, n: usize) -> Self
pub fn theme(self, theme: impl Into<String>) -> Self
pub fn word_wrap(self, wrap: bool) -> Self
pub fn show_locals(self, show: bool) -> Self
pub fn indent_guides(self, guides: bool) -> Self
pub fn locals_max_length(self, n: usize) -> Self
pub fn locals_max_string(self, n: usize) -> Self
pub fn locals_max_depth(self, n: usize) -> Self
pub fn locals_hide_dunder(self, hide: bool) -> Self
pub fn locals_hide_sunder(self, hide: bool) -> Self
pub fn suppress(self, suppress: Vec<String>) -> Self
pub fn max_frames(self, n: usize) -> Self
Trait Implementations§
Source§impl Renderable for Traceback
impl Renderable for Traceback
fn render(&self, options: &ConsoleOptions) -> RenderResult
Source§fn measure(&self, _options: &ConsoleOptions) -> Option<Measurement>
fn measure(&self, _options: &ConsoleOptions) -> Option<Measurement>
Optional width-measurement hook (equivalent to
__rich_measure__).
Override to provide min/max width constraints for layout.Auto Trait Implementations§
impl Freeze for Traceback
impl RefUnwindSafe for Traceback
impl Send for Traceback
impl Sync for Traceback
impl Unpin for Traceback
impl UnsafeUnpin for Traceback
impl UnwindSafe for Traceback
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