pub struct JsonRecordScanner { /* private fields */ }Expand description
Stateful scanner that turns output text into JSON and text events
Implementations§
Source§impl JsonRecordScanner
impl JsonRecordScanner
Sourcepub fn with_max_pending_bytes(max_pending_bytes: usize) -> Self
pub fn with_max_pending_bytes(max_pending_bytes: usize) -> Self
Create a scanner that releases an unbalanced buffer past max_pending_bytes
Sourcepub fn write(&mut self, chunk: &str) -> Vec<JsonRecordEvent>
pub fn write(&mut self, chunk: &str) -> Vec<JsonRecordEvent>
Feed a chunk and return the events it completes
Sourcepub fn flush(&mut self) -> Vec<JsonRecordEvent>
pub fn flush(&mut self) -> Vec<JsonRecordEvent>
Return the events left in the buffer at end of output
Trait Implementations§
Source§impl Clone for JsonRecordScanner
impl Clone for JsonRecordScanner
Source§impl Debug for JsonRecordScanner
impl Debug for JsonRecordScanner
Auto Trait Implementations§
impl Forget for JsonRecordScanner
impl Freeze for JsonRecordScanner
impl Move for JsonRecordScanner
impl RefUnwindSafe for JsonRecordScanner
impl Send for JsonRecordScannerwhere
RawVecInner: Send,
impl Sync for JsonRecordScannerwhere
RawVecInner: Sync,
impl Unpin for JsonRecordScanner
impl UnsafeUnpin for JsonRecordScanner
impl UnwindSafe for JsonRecordScannerwhere
RawVecInner: UnwindSafe,
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> 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.