Struct jaded::Parser

source ·
pub struct Parser<T: Read> { /* private fields */ }
Expand description

The main parser class

// Input can be anything that implements Read, eg file or tcp stream
let sample = File::open("sample").expect("Sample file missing");
// Stream is checked at creation to ensure stream is java serialization
let mut parser = Parser::new(sample)?;
// Objects are read from stream in turn
let obj = parser.read()?;
println!("Read Object: {:?}", obj);
println!("Class name: {}", obj.value().object_data().class_name());

Implementations§

Create a parser to read Java objects from a serial stream

Read the next item from the Java stream

Read the next item from the stream and convert it to required type

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.