Trait ContextImpl

Source
pub trait ContextImpl<'g> {
    type IterArgs;
    type IterItem;
    type Existing;

    // Required methods
    fn dir_name(fixture: &'g JsonFixture) -> Utf8PathBuf;
    fn file_name(fixture: &'g JsonFixture, item: &Self::IterItem) -> String;
    fn iter(
        fixture: &'g JsonFixture,
        args: &Self::IterArgs,
    ) -> Box<dyn Iterator<Item = Self::IterItem> + 'g>;
    fn parse_existing(
        path: &Utf8Path,
        contents: String,
    ) -> Result<Self::Existing>;
    fn is_changed(item: &Self::IterItem, existing: &Self::Existing) -> bool;
    fn diff(
        fixture: &'g JsonFixture,
        item: &Self::IterItem,
        existing: Option<&Self::Existing>,
    ) -> String;
    fn write_to_string(
        fixture: &'g JsonFixture,
        item: &Self::IterItem,
        out: &mut String,
    ) -> Result<()>;
}

Required Associated Types§

Required Methods§

Source

fn dir_name(fixture: &'g JsonFixture) -> Utf8PathBuf

Source

fn file_name(fixture: &'g JsonFixture, item: &Self::IterItem) -> String

Source

fn iter( fixture: &'g JsonFixture, args: &Self::IterArgs, ) -> Box<dyn Iterator<Item = Self::IterItem> + 'g>

Source

fn parse_existing(path: &Utf8Path, contents: String) -> Result<Self::Existing>

Source

fn is_changed(item: &Self::IterItem, existing: &Self::Existing) -> bool

Source

fn diff( fixture: &'g JsonFixture, item: &Self::IterItem, existing: Option<&Self::Existing>, ) -> String

Source

fn write_to_string( fixture: &'g JsonFixture, item: &Self::IterItem, out: &mut String, ) -> Result<()>

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§