Struct jaded::Parser [−][src]
pub struct Parser<T: Read> { /* fields omitted */ }
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
impl<T: Read> Parser<T>
[src]
impl<T: Read> Parser<T>
[src]pub fn new(source: T) -> Result<Self>
[src]
Create a parser to read Java objects from a serial stream
pub fn read(&mut self) -> ReadResult<Content>
[src]
Read the next item from the Java stream
pub fn read_as<S: FromJava>(&mut self) -> Result<S>
[src]
Read the next item from the stream and convert it to required type
Auto Trait Implementations
impl<T> RefUnwindSafe for Parser<T> where
T: RefUnwindSafe,
impl<T> RefUnwindSafe for Parser<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Parser<T> where
T: UnwindSafe,
impl<T> UnwindSafe for Parser<T> where
T: UnwindSafe,