pub struct JsonOutputStream { /* private fields */ }Expand description
JSON Output Stream class Processes streaming output and emits parsed JSON messages
Implementations§
Source§impl JsonOutputStream
impl JsonOutputStream
Sourcepub fn set_on_message<F>(&mut self, callback: F)
pub fn set_on_message<F>(&mut self, callback: F)
Set callback for each parsed message
Sourcepub fn set_on_error<F>(&mut self, callback: F)where
F: Fn(&ParseError) + 'static,
pub fn set_on_error<F>(&mut self, callback: F)where
F: Fn(&ParseError) + 'static,
Set callback for parse errors
Sourcepub fn set_on_raw_line<F>(&mut self, callback: F)
pub fn set_on_raw_line<F>(&mut self, callback: F)
Set callback for each raw line
Sourcepub fn get_messages(&self) -> &[Value]
pub fn get_messages(&self) -> &[Value]
Get all collected messages
Sourcepub fn get_errors(&self) -> &[ParseError]
pub fn get_errors(&self) -> &[ParseError]
Get all parse errors
Sourcepub fn filter_by_type(&self, msg_type: &str) -> Vec<&Value>
pub fn filter_by_type(&self, msg_type: &str) -> Vec<&Value>
Trait Implementations§
Source§impl Debug for JsonOutputStream
impl Debug for JsonOutputStream
Auto Trait Implementations§
impl !RefUnwindSafe for JsonOutputStream
impl !Send for JsonOutputStream
impl !Sync for JsonOutputStream
impl !UnwindSafe for JsonOutputStream
impl Freeze for JsonOutputStream
impl Unpin for JsonOutputStream
impl UnsafeUnpin for JsonOutputStream
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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