pub trait Serializer<'a> {
Show 20 methods
// Required methods
fn write_u8(&mut self, n: u8);
fn write_u16(&mut self, n: u16);
fn write_u32(&mut self, n: u32);
fn write_u64(&mut self, n: u64);
fn write_u128(&mut self, n: u128);
fn write_i8(&mut self, n: i8);
fn write_i16(&mut self, n: i16);
fn write_i32(&mut self, n: i32);
fn write_i64(&mut self, n: i64);
fn write_i128(&mut self, n: i128);
fn write_f32(&mut self, n: f32);
fn write_f64(&mut self, n: f64);
fn write_bool(&mut self, b: bool);
fn write_bytes(&mut self, bytes: &[u8]);
fn write_string(&mut self, s: &str);
fn write_seq<F>(&mut self, len: usize, f: F)
where F: FnOnce(&mut Self);
fn write_map<F>(&mut self, len: usize, f: F)
where F: FnOnce(&mut Self);
fn write_tuple<F>(&mut self, len: usize, f: F)
where F: FnOnce(&mut Self);
fn write_struct<F>(&mut self, name: &'a str, fields: &'a [&'a str], f: F)
where F: FnOnce(&mut Self);
fn write_enum<F>(
&mut self,
enum_name: &'a str,
variant_index: u32,
variant_name: &'a [&'a str],
f: F,
)
where F: FnOnce(&mut Self);
}Required Methods§
fn write_u8(&mut self, n: u8)
fn write_u16(&mut self, n: u16)
fn write_u32(&mut self, n: u32)
fn write_u64(&mut self, n: u64)
fn write_u128(&mut self, n: u128)
fn write_i8(&mut self, n: i8)
fn write_i16(&mut self, n: i16)
fn write_i32(&mut self, n: i32)
fn write_i64(&mut self, n: i64)
fn write_i128(&mut self, n: i128)
fn write_f32(&mut self, n: f32)
fn write_f64(&mut self, n: f64)
fn write_bool(&mut self, b: bool)
fn write_bytes(&mut self, bytes: &[u8])
fn write_string(&mut self, s: &str)
fn write_seq<F>(&mut self, len: usize, f: F)where
F: FnOnce(&mut Self),
fn write_map<F>(&mut self, len: usize, f: F)where
F: FnOnce(&mut Self),
fn write_tuple<F>(&mut self, len: usize, f: F)where
F: FnOnce(&mut Self),
fn write_struct<F>(&mut self, name: &'a str, fields: &'a [&'a str], f: F)where
F: FnOnce(&mut Self),
fn write_enum<F>(
&mut self,
enum_name: &'a str,
variant_index: u32,
variant_name: &'a [&'a str],
f: F,
)where
F: FnOnce(&mut Self),
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.