pub struct StructuredEvent {
pub message: Message,
pub fields: Vec<(String, Value)>,
pub context: EventContext,
/* private fields */
}Fields§
§message: Message§fields: Vec<(String, Value)>§context: EventContextImplementations§
Source§impl StructuredEvent
impl StructuredEvent
pub fn new(message: Message) -> Self
pub fn diagnostic(self, diagnostic: Diagnostic) -> Self
pub fn field(self, key: impl Into<String>, value: Value) -> Self
pub fn field_order(self, keys: Vec<String>) -> Self
pub fn hide_fields(self, keys: Vec<String>) -> Self
pub fn view(self, view: EventView) -> Self
pub fn context(self, context: EventContext) -> Self
pub fn overflow(self, overflow: OverflowPolicy) -> Self
Sourcepub fn spans(self, spans: Vec<SpanContext>) -> Self
pub fn spans(self, spans: Vec<SpanContext>) -> Self
The spans the event happened in, outermost first.
Sourcepub fn span_event(self, event: SpanEvent) -> Self
pub fn span_event(self, event: SpanEvent) -> Self
Mark the event as a span opening or closing. Its message is the span’s
name, its fields the span’s, and spans its parents.
Sourcepub fn span_context(&self) -> &[SpanContext]
pub fn span_context(&self) -> &[SpanContext]
The spans the event happened in, outermost first.
Sourcepub fn span_marker(&self) -> Option<SpanEvent>
pub fn span_marker(&self) -> Option<SpanEvent>
Whether the event reports a span opening or closing.
Trait Implementations§
Source§impl Clone for StructuredEvent
impl Clone for StructuredEvent
Source§impl Debug for StructuredEvent
impl Debug for StructuredEvent
Source§impl Renderable for StructuredEvent
impl Renderable for StructuredEvent
fn rich_render( &self, console: &Console, options: &ConsoleOptions, ) -> Vec<Segment>
Source§fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
The
(minimum, maximum) cell width this renderable wants. Port of
__rich_measure__. The default is what upstream’s Measurement.get
returns for a renderable without one: anything from nothing to the
whole width, (0, max_width).Source§fn fit_to_measurement(&self) -> bool
fn fit_to_measurement(&self) -> bool
Whether a top-level
Console::print shrinks this renderable to its
measured width. Upstream renders every top-level renderable at the full
console width, so the default is false; an extension may opt in.Source§fn vertical(&self) -> Option<VerticalAlign>
fn vertical(&self) -> Option<VerticalAlign>
The vertical alignment a
Table cell holding this renderable uses in
place of its column’s. Upstream reads getattr(renderable, "vertical", None); Align sets it.Source§fn print_end_line(&self, _options: &ConsoleOptions) -> bool
fn print_end_line(&self, _options: &ConsoleOptions) -> bool
Whether a top-level print ends this renderable’s last line. This
port’s renderables separate lines, where upstream’s end each line
with
"\n", so a print adds the final line break. A renderable
whose upstream output stops without one (Screen, LiveRender, a
Rule whose end has no newline) returns false, and the next
output continues its last line. options are the print’s options.Auto Trait Implementations§
impl Freeze for StructuredEvent
impl RefUnwindSafe for StructuredEvent
impl Send for StructuredEvent
impl Sync for StructuredEvent
impl Unpin for StructuredEvent
impl UnsafeUnpin for StructuredEvent
impl UnwindSafe for StructuredEvent
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