Skip to main content

ToYamlFragment

Trait ToYamlFragment 

Source
pub trait ToYamlFragment {
    // Required method
    fn to_yaml_fragment(
        &self,
        indent: usize,
        line_ending: &str,
    ) -> Result<String, YamlError>;
}
Expand description

Formats a typed value as a YAML fragment for parent-aware insertions.

Required Methods§

Source

fn to_yaml_fragment( &self, indent: usize, line_ending: &str, ) -> Result<String, YamlError>

Formats self using indent spaces for nested block lines.

§Errors

Returns an error when the value cannot be represented by the current conservative block-style formatter.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ToYamlFragment for &str

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for String

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for bool

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for char

Source§

fn to_yaml_fragment( &self, indent: usize, line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for f32

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for f64

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for i8

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for i16

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for i32

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for i64

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for i128

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for isize

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for u8

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for u16

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for u32

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for u64

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for u128

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl ToYamlFragment for usize

Source§

fn to_yaml_fragment( &self, _indent: usize, _line_ending: &str, ) -> Result<String, YamlError>

Source§

impl<T, S> ToYamlFragment for HashMap<String, T, S>

Source§

fn to_yaml_fragment( &self, indent: usize, line_ending: &str, ) -> Result<String, YamlError>

Source§

impl<T, const N: usize> ToYamlFragment for [T; N]
where T: ToYamlFragment,

Source§

fn to_yaml_fragment( &self, indent: usize, line_ending: &str, ) -> Result<String, YamlError>

Source§

impl<T> ToYamlFragment for BTreeMap<String, T>
where T: ToYamlFragment,

Source§

fn to_yaml_fragment( &self, indent: usize, line_ending: &str, ) -> Result<String, YamlError>

Source§

impl<T> ToYamlFragment for Box<T>
where T: ToYamlFragment,

Source§

fn to_yaml_fragment( &self, indent: usize, line_ending: &str, ) -> Result<String, YamlError>

Source§

impl<T> ToYamlFragment for Option<T>
where T: ToYamlFragment,

Source§

fn to_yaml_fragment( &self, indent: usize, line_ending: &str, ) -> Result<String, YamlError>

Source§

impl<T> ToYamlFragment for Vec<T>
where T: ToYamlFragment,

Source§

fn to_yaml_fragment( &self, indent: usize, line_ending: &str, ) -> Result<String, YamlError>

Implementors§