Function delegates

Source
pub fn delegates<S>(
    raw: RawDoc,
    additions: Vec<Did>,
    removals: Vec<Did>,
    repo: &S,
) -> Result<Result<RawDoc, Vec<DelegateVerification>>, RepositoryError>
where S: ReadRepository,
Expand description

Change the delegates of the document and perform some verification based on the new set of delegates.

The set of additions are added to the delegates, while the set to removals are removed from the delegates. Note that removals will take precedence over the additions, i.e. if an addition and removal overlap, then the Did will not be in the final set.

The result is either the updated RawDoc or a set of error::DelegateVerification errors – which may be reported by the caller to provide better error messaging.

§Errors

This will fail if an operation using the repository fails.