pub trait RefEditsExt<T>where
    T: Borrow<RefEdit> + BorrowMut<RefEdit>,{
    // Required methods
    fn assure_one_name_has_one_edit(&self) -> Result<(), BString>;
    fn extend_with_splits_of_symbolic_refs(
        &mut self,
        find: &mut dyn FnMut(&PartialNameRef) -> Option<Target>,
        make_entry: &mut dyn FnMut(usize, RefEdit) -> T
    ) -> Result<(), Error>;

    // Provided method
    fn pre_process(
        &mut self,
        find: &mut dyn FnMut(&PartialNameRef) -> Option<Target>,
        make_entry: &mut dyn FnMut(usize, RefEdit) -> T
    ) -> Result<(), Error> { ... }
}
Expand description

An extension trait to perform commonly used operations on edits across different ref stores.

Required Methods§

source

fn assure_one_name_has_one_edit(&self) -> Result<(), BString>

Return true if each ref name has exactly one edit across multiple ref edits

source

fn extend_with_splits_of_symbolic_refs( &mut self, find: &mut dyn FnMut(&PartialNameRef) -> Option<Target>, make_entry: &mut dyn FnMut(usize, RefEdit) -> T ) -> Result<(), Error>

Split all symbolic refs into updates for the symbolic ref as well as all their referents if the deref flag is enabled.

Note no action is performed if deref isn’t specified.

Provided Methods§

source

fn pre_process( &mut self, find: &mut dyn FnMut(&PartialNameRef) -> Option<Target>, make_entry: &mut dyn FnMut(usize, RefEdit) -> T ) -> Result<(), Error>

All processing steps in one and in the correct order.

Users call this to assure derefs are honored and duplicate checks are done.

Implementations on Foreign Types§

source§

impl<E> RefEditsExt<E> for Vec<E>where E: Borrow<RefEdit> + BorrowMut<RefEdit>,

source§

fn assure_one_name_has_one_edit(&self) -> Result<(), BString>

source§

fn extend_with_splits_of_symbolic_refs( &mut self, find: &mut dyn FnMut(&PartialNameRef) -> Option<Target>, make_entry: &mut dyn FnMut(usize, RefEdit) -> E ) -> Result<(), Error>

Implementors§