pub trait ToToml {
Show 16 methods
// Provided methods
fn try_to_toml_value(&self) -> Result<TomlValue>
where Self: Serialize { ... }
fn try_from_toml_value(value: TomlValue) -> Result<Self>
where Self: DeserializeOwned { ... }
fn to_toml_value(&self) -> TomlValue
where Self: Serialize { ... }
fn from_toml_value(value: TomlValue) -> Self
where Self: DeserializeOwned { ... }
fn try_to_toml(&self) -> Result<String>
where Self: Serialize { ... }
fn try_to_toml_into(&self, writer: impl Write) -> Result<()>
where Self: Serialize { ... }
fn try_from_toml(toml: impl AsBytes) -> Result<Self>
where Self: DeserializeOwned { ... }
fn try_from_toml_from(reader: impl Read) -> Result<Self>
where Self: DeserializeOwned { ... }
fn to_toml(&self) -> String
where Self: Serialize { ... }
fn to_toml_into(&self, writer: impl Write)
where Self: Serialize { ... }
fn from_toml(toml: impl AsBytes) -> Self
where Self: DeserializeOwned { ... }
fn from_toml_from(reader: impl Read) -> Self
where Self: DeserializeOwned { ... }
fn try_to_toml_pretty(&self) -> Result<String>
where Self: Serialize { ... }
fn try_to_toml_pretty_into(&self, writer: impl Write) -> Result<()>
where Self: Serialize { ... }
fn to_toml_pretty(&self) -> String
where Self: Serialize { ... }
fn to_toml_pretty_into(&self, writer: impl Write)
where Self: Serialize { ... }
}Expand description
§A trait that can de/encode to/from toml.
Provided Methods§
fn try_to_toml_value(&self) -> Result<TomlValue>where
Self: Serialize,
fn try_from_toml_value(value: TomlValue) -> Result<Self>where
Self: DeserializeOwned,
fn to_toml_value(&self) -> TomlValuewhere
Self: Serialize,
fn from_toml_value(value: TomlValue) -> Selfwhere
Self: DeserializeOwned,
fn try_to_toml(&self) -> Result<String>where
Self: Serialize,
Sourcefn try_to_toml_into(&self, writer: impl Write) -> Result<()>where
Self: Serialize,
fn try_to_toml_into(&self, writer: impl Write) -> Result<()>where
Self: Serialize,
§Optimized
This function is not well optimized yet.
fn try_from_toml(toml: impl AsBytes) -> Result<Self>where
Self: DeserializeOwned,
Sourcefn try_from_toml_from(reader: impl Read) -> Result<Self>where
Self: DeserializeOwned,
fn try_from_toml_from(reader: impl Read) -> Result<Self>where
Self: DeserializeOwned,
§Optimized
This function is not well optimized yet.
fn to_toml(&self) -> Stringwhere
Self: Serialize,
fn to_toml_into(&self, writer: impl Write)where
Self: Serialize,
fn from_toml(toml: impl AsBytes) -> Selfwhere
Self: DeserializeOwned,
fn from_toml_from(reader: impl Read) -> Selfwhere
Self: DeserializeOwned,
fn try_to_toml_pretty(&self) -> Result<String>where
Self: Serialize,
Sourcefn try_to_toml_pretty_into(&self, writer: impl Write) -> Result<()>where
Self: Serialize,
fn try_to_toml_pretty_into(&self, writer: impl Write) -> Result<()>where
Self: Serialize,
§Optimized
This function is not well optimized yet.
fn to_toml_pretty(&self) -> Stringwhere
Self: Serialize,
Sourcefn to_toml_pretty_into(&self, writer: impl Write)where
Self: Serialize,
fn to_toml_pretty_into(&self, writer: impl Write)where
Self: Serialize,
§Optimized
This function is not well optimized yet.
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.