pub struct LogStream {
pub name: String,
pub color: Color,
pub entries: Vec<CorrelationEntry>,
pub filter: String,
pub min_level: Option<CorrelationLevel>,
}Expand description
A single log stream (source) in the correlation view.
Fields§
§name: StringName of this stream (e.g., service name).
color: ColorColor for this stream’s header.
entries: Vec<CorrelationEntry>All entries in this stream.
filter: StringPer-stream text filter.
min_level: Option<CorrelationLevel>Per-stream minimum severity level filter.
Implementations§
Source§impl LogStream
impl LogStream
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Creates a new empty log stream with the given name.
§Example
use envision::component::LogStream;
let stream = LogStream::new("API Server");
assert_eq!(stream.name, "API Server");
assert!(stream.entries.is_empty());Sourcepub fn with_color(self, color: Color) -> Self
pub fn with_color(self, color: Color) -> Self
Sets the header color (builder pattern).
§Example
use envision::component::LogStream;
use ratatui::prelude::Color;
let stream = LogStream::new("API").with_color(Color::Cyan);
assert_eq!(stream.color, Color::Cyan);Sourcepub fn set_color(&mut self, color: Color)
pub fn set_color(&mut self, color: Color)
Sets the header color.
§Example
use envision::component::LogStream;
use ratatui::prelude::Color;
let mut stream = LogStream::new("API");
stream.set_color(Color::Cyan);
assert_eq!(stream.color, Color::Cyan);Sourcepub fn with_entry(self, entry: CorrelationEntry) -> Self
pub fn with_entry(self, entry: CorrelationEntry) -> Self
Appends an entry to the stream (builder pattern).
§Example
use envision::component::{LogStream, CorrelationEntry, CorrelationLevel};
let stream = LogStream::new("API")
.with_entry(CorrelationEntry::new(1.0, CorrelationLevel::Info, "Started"));
assert_eq!(stream.entries.len(), 1);Trait Implementations§
Source§impl<'de> Deserialize<'de> for LogStream
impl<'de> Deserialize<'de> for LogStream
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
impl StructuralPartialEq for LogStream
Auto Trait Implementations§
impl Freeze for LogStream
impl RefUnwindSafe for LogStream
impl Send for LogStream
impl Sync for LogStream
impl Unpin for LogStream
impl UnsafeUnpin for LogStream
impl UnwindSafe for LogStream
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more