Skip to main content

NoteDefault

Trait NoteDefault 

Source
pub trait NoteDefault: Note {
    // Required methods
    fn from_string_default(
        raw_text: impl AsRef<str>,
    ) -> Result<Self, Self::Error>
       where Self: NoteFromString,
             Self::Properties: DeserializeOwned;
    fn from_file_default(path: impl AsRef<Path>) -> Result<Self, Self::Error>
       where Self: NoteFromFile,
             Self::Properties: DeserializeOwned,
             Self::Error: From<Error>;
    fn from_reader_default(reader: &mut impl Read) -> Result<Self, Self::Error>
       where Self: NoteFromReader,
             Self::Properties: DeserializeOwned,
             Self::Error: From<Error>;
}
Expand description

Default implementation using std::collections::HashMap for properties

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

Required Methods§

Source

fn from_string_default(raw_text: impl AsRef<str>) -> Result<Self, Self::Error>

Same as NoteFromString::from_string with default properties type

Source

fn from_file_default(path: impl AsRef<Path>) -> Result<Self, Self::Error>
where Self: NoteFromFile, Self::Properties: DeserializeOwned, Self::Error: From<Error>,

Available on non-target_family=wasm only.

Same as crate::note::NoteFromFile::from_file with default properties type

Source

fn from_reader_default(reader: &mut impl Read) -> Result<Self, Self::Error>

Same as NoteFromReader::from_reader with default properties type

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T> NoteDefault for T
where T: Note<Properties = HashMap<String, Value>>,