Skip to main content

ToTeaLeafExt

Trait ToTeaLeafExt 

Source
pub trait ToTeaLeafExt: ToTeaLeaf + Sized {
    // Provided methods
    fn to_tealeaf_doc(&self, key: &str) -> TeaLeaf { ... }
    fn to_tl_string(&self, key: &str) -> String { ... }
    fn to_tlbx(
        &self,
        key: &str,
        path: impl AsRef<Path>,
        compress: bool,
    ) -> Result<()> { ... }
    fn to_tealeaf_json(&self, key: &str) -> Result<String> { ... }
}
Expand description

Extension trait providing convenience methods on types implementing ToTeaLeaf.

Provided Methods§

Source

fn to_tealeaf_doc(&self, key: &str) -> TeaLeaf

Convert to a TeaLeaf document with a single root entry.

Source

fn to_tl_string(&self, key: &str) -> String

Convert to TeaLeaf text format string.

Source

fn to_tlbx( &self, key: &str, path: impl AsRef<Path>, compress: bool, ) -> Result<()>

Compile to binary .tlbx format.

Source

fn to_tealeaf_json(&self, key: &str) -> Result<String>

Convert to JSON string (pretty-printed).

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.

Implementors§