pub struct TomlEngine;Expand description
TOML format engine implementing FormatEngine.
Trait Implementations§
Source§impl Clone for TomlEngine
impl Clone for TomlEngine
Source§fn clone(&self) -> TomlEngine
fn clone(&self) -> TomlEngine
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TomlEngine
Source§impl Debug for TomlEngine
impl Debug for TomlEngine
Source§impl Default for TomlEngine
impl Default for TomlEngine
Source§fn default() -> TomlEngine
fn default() -> TomlEngine
Returns the “default value” for a type. Read more
Source§impl FormatEngine for TomlEngine
impl FormatEngine for TomlEngine
Source§fn format_id(&self) -> &'static str
fn format_id(&self) -> &'static str
Unique format identifier (e.g., “json”, “yaml”, “toml”, “xml”, “bencode”).
Source§fn file_extensions(&self) -> &'static [&'static str]
fn file_extensions(&self) -> &'static [&'static str]
Associated file extensions without leading dots (e.g., &[“json”, “jsonl”]).
Source§fn parse_str(&self, input: &str) -> Result<Value, BabbelError>
fn parse_str(&self, input: &str) -> Result<Value, BabbelError>
Convenient parsing from UTF-8 text string.
Source§fn serialize(
&self,
value: &Value,
destination: &mut dyn IDestination,
_options: &FormatOptions,
) -> Result<(), BabbelError>
fn serialize( &self, value: &Value, destination: &mut dyn IDestination, _options: &FormatOptions, ) -> Result<(), BabbelError>
Serialize universal Value AST into output destination with format options.
Source§fn is_binary(&self) -> bool
fn is_binary(&self) -> bool
Whether this format is binary-encoded rather than UTF-8 text (default: false).
Source§fn parse(&self, source: &mut dyn ISource) -> Result<Value, BabbelError>
fn parse(&self, source: &mut dyn ISource) -> Result<Value, BabbelError>
Parse raw stream into universal Value AST. Read more
Source§fn parse_bytes(&self, input: &[u8]) -> Result<Value, BabbelError>
fn parse_bytes(&self, input: &[u8]) -> Result<Value, BabbelError>
Convenient parsing from raw byte slice.
Source§fn serialize_to_string(
&self,
value: &Value,
options: &FormatOptions,
) -> Result<String, BabbelError>
fn serialize_to_string( &self, value: &Value, options: &FormatOptions, ) -> Result<String, BabbelError>
Convenient serialization to String.
Source§fn serialize_to_vec(
&self,
value: &Value,
options: &FormatOptions,
) -> Result<Vec<u8>, BabbelError>
fn serialize_to_vec( &self, value: &Value, options: &FormatOptions, ) -> Result<Vec<u8>, BabbelError>
Convenient serialization to bytes.
Source§fn parse_documents(&self, input: &str) -> Result<Vec<Value>, BabbelError>
fn parse_documents(&self, input: &str) -> Result<Vec<Value>, BabbelError>
Parses one or more documents from a string stream (e.g. multi-doc YAML or JSON Lines).
Source§fn parse_documents_bytes(&self, input: &[u8]) -> Result<Vec<Value>, BabbelError>
fn parse_documents_bytes(&self, input: &[u8]) -> Result<Vec<Value>, BabbelError>
Parses one or more documents from a byte stream (e.g. RFC 8742 CBOR Sequences).
Auto Trait Implementations§
impl Freeze for TomlEngine
impl RefUnwindSafe for TomlEngine
impl Send for TomlEngine
impl Sync for TomlEngine
impl Unpin for TomlEngine
impl UnsafeUnpin for TomlEngine
impl UnwindSafe for TomlEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FormatCodec for Twhere
T: FormatEngine + ?Sized,
impl<T> FormatCodec for Twhere
T: FormatEngine + ?Sized,
Source§fn format_name(&self) -> &'static str
fn format_name(&self) -> &'static str
Returns the name of the format (e.g., “json”, “yaml”, “xml”, “bencode”).
Source§impl<T> FormatEmitter for Twhere
T: FormatEngine + ?Sized,
impl<T> FormatEmitter for Twhere
T: FormatEngine + ?Sized,
Source§fn emit(
&self,
value: &Value,
dest: &mut dyn IDestination,
) -> Result<(), BabbelError>
fn emit( &self, value: &Value, dest: &mut dyn IDestination, ) -> Result<(), BabbelError>
Serializes a
Value to the output destination in compact/standard format.Source§fn emit_pretty(
&self,
value: &Value,
dest: &mut dyn IDestination,
indent: usize,
) -> Result<(), BabbelError>
fn emit_pretty( &self, value: &Value, dest: &mut dyn IDestination, indent: usize, ) -> Result<(), BabbelError>
Serializes a
Value to the output destination with pretty printing.Source§impl<T> FormatParser for Twhere
T: FormatEngine + ?Sized,
impl<T> FormatParser for Twhere
T: FormatEngine + ?Sized,
Source§fn parse_str(&self, input: &str) -> Result<Value, BabbelError>
fn parse_str(&self, input: &str) -> Result<Value, BabbelError>
Parses a UTF-8 string into a universal
Value.Source§fn parse_bytes(&self, input: &[u8]) -> Result<Value, BabbelError>
fn parse_bytes(&self, input: &[u8]) -> Result<Value, BabbelError>
Parses a raw byte slice into a universal
Value.