poem_openapi::types

Trait ToYAML

Source
pub trait ToYAML: Type {
    // Required method
    fn to_yaml(&self) -> Option<Value>;

    // Provided method
    fn to_yaml_string(&self) -> String { ... }
}
Expand description

Represents a type that can converted to YAML value.

Required Methods§

Source

fn to_yaml(&self) -> Option<Value>

Convert this value to Value.

Provided Methods§

Source

fn to_yaml_string(&self) -> String

Convert this value to YAML string.

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.

Implementations on Foreign Types§

Source§

impl<T: ToYAML> ToYAML for &T

Source§

impl<T: ToYAML> ToYAML for Box<T>

Implementors§