Struct ion_binary_rs::IonParser[][src]

pub struct IonParser<T: Read> { /* fields omitted */ }
Expand description

In order to use it call the new method and then the “consume_all” method.

Example


use ion_binary_rs::IonParser;

// This is the response from Amazon's QLDB introduction example using Rusoto
let ion_test = b"\xe0\x01\0\xea\xee\xa6\x81\x83\xde\xa2\x87\xbe\x9f\x83VIN\x84Type\x84Year\x84Make\x85Model\x85Color\xde\xb9\x8a\x8e\x911C4RJFAG0FC625797\x8b\x85Sedan\x8c\"\x07\xe3\x8d\x88Mercedes\x8e\x87CLK 350\x8f\x85White";

let mut parser = IonParser::new(&ion_test[..]);

println!("Decoded Ion: {:?}", parser.consume_all().unwrap())
// Decoded Ion: [Struct({"Color": String("White"), "Year": Integer(2019), "VIN": String("1C4RJFAG0FC625797"), "Make": String("Mercedes"), "Model": String("CLK 350"), "Type": String("Sedan")})]

Implementations

Creates a new parser. It accepts anything that implements the trait Read Trait

Allows to set up shared tables in order to define symbols that are not in the binary blob. This is useful when decoding binaries that depend of huge tables that are expected to exist in the client and not to be sent in the ion binary.

Consumes all the IonValues in the binary blob and returns an array with them.

Consumes one IonValue and stops. This function will automatically process NOP Padding, Shared Tables and Local Tables, automatically continuing in case that any of them are found.

Trait Implementations

Formats the value using the given formatter. Read more

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

Performs the conversion.

Performs the conversion.

Should always be Self

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.