Skip to main content

SchemaSource

Trait SchemaSource 

Source
pub trait SchemaSource {
Show 20 methods // Required methods fn seq_begin(&mut self) -> Result<usize, SchemaError>; fn take_bool(&mut self) -> Result<bool, SchemaError>; fn take_u8(&mut self) -> Result<u8, SchemaError>; fn take_i8(&mut self) -> Result<i8, SchemaError>; fn take_u16(&mut self) -> Result<u16, SchemaError>; fn take_i16(&mut self) -> Result<i16, SchemaError>; fn take_u32(&mut self) -> Result<u32, SchemaError>; fn take_i32(&mut self) -> Result<i32, SchemaError>; fn take_u64(&mut self) -> Result<u64, SchemaError>; fn take_i64(&mut self) -> Result<i64, SchemaError>; fn take_f32(&mut self) -> Result<f32, SchemaError>; fn take_f64(&mut self) -> Result<f64, SchemaError>; fn take_str(&mut self) -> Result<&str, SchemaError>; // Provided methods fn struct_begin(&mut self, type_name: &str) -> Result<(), SchemaError> { ... } fn struct_end(&mut self) -> Result<(), SchemaError> { ... } fn field_begin(&mut self, field: &'static Field) -> Result<(), SchemaError> { ... } fn field_end(&mut self, field: &'static Field) -> Result<(), SchemaError> { ... } fn array_begin(&mut self, len: usize) -> Result<(), SchemaError> { ... } fn array_end(&mut self) -> Result<(), SchemaError> { ... } fn seq_end(&mut self) -> Result<(), SchemaError> { ... }
}
Expand description

The decode half: the walk pulls typed values out, in schema order.

Exactly dual to SchemaSink. The walk knows what comes next from the schema, so the implementor never has to parse a type tag it did not write.

Required Methods§

Source

fn seq_begin(&mut self) -> Result<usize, SchemaError>

Read the element count of a sequence off the wire.

Source

fn take_bool(&mut self) -> Result<bool, SchemaError>

Read an IDL boolean.

Source

fn take_u8(&mut self) -> Result<u8, SchemaError>

Read an IDL octet / uint8.

Source

fn take_i8(&mut self) -> Result<i8, SchemaError>

Read an IDL int8.

Source

fn take_u16(&mut self) -> Result<u16, SchemaError>

Read an IDL uint16.

Source

fn take_i16(&mut self) -> Result<i16, SchemaError>

Read an IDL int16.

Source

fn take_u32(&mut self) -> Result<u32, SchemaError>

Read an IDL uint32.

Source

fn take_i32(&mut self) -> Result<i32, SchemaError>

Read an IDL int32.

Source

fn take_u64(&mut self) -> Result<u64, SchemaError>

Read an IDL uint64.

Source

fn take_i64(&mut self) -> Result<i64, SchemaError>

Read an IDL int64.

Source

fn take_f32(&mut self) -> Result<f32, SchemaError>

Read an IDL float.

Source

fn take_f64(&mut self) -> Result<f64, SchemaError>

Read an IDL double.

Source

fn take_str(&mut self) -> Result<&str, SchemaError>

Read an IDL narrow string, borrowed out of the source buffer.

Provided Methods§

Source

fn struct_begin(&mut self, type_name: &str) -> Result<(), SchemaError>

Entering a struct — the top-level message, or a nested member.

Source

fn struct_end(&mut self) -> Result<(), SchemaError>

Leaving the struct opened by the matching Self::struct_begin.

Source

fn field_begin(&mut self, field: &'static Field) -> Result<(), SchemaError>

Entering one field.

Source

fn field_end(&mut self, field: &'static Field) -> Result<(), SchemaError>

Leaving the field opened by the matching Self::field_begin.

Source

fn array_begin(&mut self, len: usize) -> Result<(), SchemaError>

A fixed-size array of len elements follows; len is from the schema.

Source

fn array_end(&mut self) -> Result<(), SchemaError>

Leaving the array opened by the matching Self::array_begin.

Source

fn seq_end(&mut self) -> Result<(), SchemaError>

Leaving the sequence opened by the matching Self::seq_begin.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§