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§
Sourcefn seq_begin(&mut self) -> Result<usize, SchemaError>
fn seq_begin(&mut self) -> Result<usize, SchemaError>
Read the element count of a sequence off the wire.
Sourcefn take_bool(&mut self) -> Result<bool, SchemaError>
fn take_bool(&mut self) -> Result<bool, SchemaError>
Read an IDL boolean.
Sourcefn take_u8(&mut self) -> Result<u8, SchemaError>
fn take_u8(&mut self) -> Result<u8, SchemaError>
Read an IDL octet / uint8.
Sourcefn take_i8(&mut self) -> Result<i8, SchemaError>
fn take_i8(&mut self) -> Result<i8, SchemaError>
Read an IDL int8.
Sourcefn take_u16(&mut self) -> Result<u16, SchemaError>
fn take_u16(&mut self) -> Result<u16, SchemaError>
Read an IDL uint16.
Sourcefn take_i16(&mut self) -> Result<i16, SchemaError>
fn take_i16(&mut self) -> Result<i16, SchemaError>
Read an IDL int16.
Sourcefn take_u32(&mut self) -> Result<u32, SchemaError>
fn take_u32(&mut self) -> Result<u32, SchemaError>
Read an IDL uint32.
Sourcefn take_i32(&mut self) -> Result<i32, SchemaError>
fn take_i32(&mut self) -> Result<i32, SchemaError>
Read an IDL int32.
Sourcefn take_u64(&mut self) -> Result<u64, SchemaError>
fn take_u64(&mut self) -> Result<u64, SchemaError>
Read an IDL uint64.
Sourcefn take_i64(&mut self) -> Result<i64, SchemaError>
fn take_i64(&mut self) -> Result<i64, SchemaError>
Read an IDL int64.
Sourcefn take_f32(&mut self) -> Result<f32, SchemaError>
fn take_f32(&mut self) -> Result<f32, SchemaError>
Read an IDL float.
Sourcefn take_f64(&mut self) -> Result<f64, SchemaError>
fn take_f64(&mut self) -> Result<f64, SchemaError>
Read an IDL double.
Sourcefn take_str(&mut self) -> Result<&str, SchemaError>
fn take_str(&mut self) -> Result<&str, SchemaError>
Read an IDL narrow string, borrowed out of the source buffer.
Provided Methods§
Sourcefn struct_begin(&mut self, type_name: &str) -> Result<(), SchemaError>
fn struct_begin(&mut self, type_name: &str) -> Result<(), SchemaError>
Entering a struct — the top-level message, or a nested member.
Sourcefn struct_end(&mut self) -> Result<(), SchemaError>
fn struct_end(&mut self) -> Result<(), SchemaError>
Leaving the struct opened by the matching Self::struct_begin.
Sourcefn field_begin(&mut self, field: &'static Field) -> Result<(), SchemaError>
fn field_begin(&mut self, field: &'static Field) -> Result<(), SchemaError>
Entering one field.
Sourcefn field_end(&mut self, field: &'static Field) -> Result<(), SchemaError>
fn field_end(&mut self, field: &'static Field) -> Result<(), SchemaError>
Leaving the field opened by the matching Self::field_begin.
Sourcefn array_begin(&mut self, len: usize) -> Result<(), SchemaError>
fn array_begin(&mut self, len: usize) -> Result<(), SchemaError>
A fixed-size array of len elements follows; len is from the schema.
Sourcefn array_end(&mut self) -> Result<(), SchemaError>
fn array_end(&mut self) -> Result<(), SchemaError>
Leaving the array opened by the matching Self::array_begin.
Sourcefn seq_end(&mut self) -> Result<(), SchemaError>
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".