Trait ObFileDefault

Source
pub trait ObFileDefault: ObFile<HashMap<String, Value>> {
    // Required methods
    fn from_string_default<P: AsRef<Path>>(
        text: &str,
        path: Option<P>,
    ) -> Result<Self, Error>;
    fn from_file_default<P: AsRef<Path>>(path: P) -> Result<Self, Error>;
}
Expand description

Default implementation using HashMap for properties

Automatically implemented for all ObFile<HashMap<..>> types. Provides identical interface with explicitly named methods.

Required Methods§

Source

fn from_string_default<P: AsRef<Path>>( text: &str, path: Option<P>, ) -> Result<Self, Error>

Same as ObFile::from_string with default properties type

§Errors
  • Error::InvalidFormat for malformed frontmatter
  • Error::Yaml for invalid YAML syntax
Source

fn from_file_default<P: AsRef<Path>>(path: P) -> Result<Self, Error>

Same as ObFile::from_file with default properties type

§Errors
  • Error::Io for filesystem errors
  • Error::FromUtf8 for non-UTF8 content

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§

Source§

impl<T> ObFileDefault for T
where T: ObFile<HashMap<String, Value>>,