Struct Carver

Source
pub struct Carver<'a> {
    pub min_size: usize,
    pub fix_incomplete: bool,
    pub report_all: bool,
    /* private fields */
}
Expand description

The Carver struct is responsible for carving JSON strings out of the provided reader, and provide output and reports to the provided writers.

Fields§

§min_size: usize

The minimum size of the JSON string that will be reported.

§fix_incomplete: bool

Whether to attempt to fix incomplete JSON strings.

§report_all: bool

Whether to report every detected JSON, not just corrupted ones.

Implementations§

Source§

impl<'a> Carver<'a>

Source

pub fn new( reader: Reader<'a>, json_writer: Writer<'a>, report_writer: Writer<'a>, max_size: Option<usize>, max_ident_depth: Option<usize>, ) -> Self

Create a new Carver instance from the provided Reader and Writer instances.

Source

pub fn replace_newlines(&mut self, opt: bool)

Configure whether to replace newlines in JSON strings or not.

Source

pub fn parse(&mut self) -> Result<(), Err>

Start carving a stream of data for JSON strings.

Auto Trait Implementations§

§

impl<'a> Freeze for Carver<'a>

§

impl<'a> RefUnwindSafe for Carver<'a>

§

impl<'a> !Send for Carver<'a>

§

impl<'a> !Sync for Carver<'a>

§

impl<'a> Unpin for Carver<'a>

§

impl<'a> UnwindSafe for Carver<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.