pub trait TomlWrite: Write {
Show 16 methods
// Provided methods
fn open_table_header(&mut self) -> Result { ... }
fn close_table_header(&mut self) -> Result { ... }
fn open_array_of_tables_header(&mut self) -> Result { ... }
fn close_array_of_tables_header(&mut self) -> Result { ... }
fn open_inline_table(&mut self) -> Result { ... }
fn close_inline_table(&mut self) -> Result { ... }
fn open_array(&mut self) -> Result { ... }
fn close_array(&mut self) -> Result { ... }
fn key_sep(&mut self) -> Result { ... }
fn keyval_sep(&mut self) -> Result { ... }
fn key(&mut self, value: impl WriteTomlKey) -> Result { ... }
fn value(&mut self, value: impl WriteTomlValue) -> Result { ... }
fn val_sep(&mut self) -> Result { ... }
fn space(&mut self) -> Result { ... }
fn open_comment(&mut self) -> Result { ... }
fn newline(&mut self) -> Result { ... }
}
Provided Methods§
fn open_table_header(&mut self) -> Result
fn close_table_header(&mut self) -> Result
fn open_array_of_tables_header(&mut self) -> Result
fn close_array_of_tables_header(&mut self) -> Result
fn open_inline_table(&mut self) -> Result
fn close_inline_table(&mut self) -> Result
fn open_array(&mut self) -> Result
fn close_array(&mut self) -> Result
fn key_sep(&mut self) -> Result
fn keyval_sep(&mut self) -> Result
fn key(&mut self, value: impl WriteTomlKey) -> Result
Sourcefn value(&mut self, value: impl WriteTomlValue) -> Result
fn value(&mut self, value: impl WriteTomlValue) -> Result
For floats, this preserves the sign bit for f32::NAN
/ f64::NAN
for the sake of
format-preserving editing.
However, in most cases the sign bit is indeterminate and outputting signed NANs can be a
cause of non-repeatable behavior.
For general serialization, you should discard the sign bit. For example:
if v.is_nan() {
v = v.copysign(1.0);
}
fn val_sep(&mut self) -> Result
fn space(&mut self) -> Result
fn open_comment(&mut self) -> Result
fn newline(&mut self) -> Result
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.