Skip to main content

IdentityPolicy

Trait IdentityPolicy 

Source
pub trait IdentityPolicy {
    // Required methods
    fn registration(&self) -> Registration;
    fn mint(&mut self, path: &Path) -> Id;
}
Expand description

A policy deciding when to register documents and how their IDs are minted.

Required Methods§

Source

fn registration(&self) -> Registration

The registration trigger set for this policy.

Source

fn mint(&mut self, path: &Path) -> Id

Mint a fresh ID for the document at path. Only called when a trigger fires, so a disabled policy need never produce a meaningful value. Uniqueness is the caller’s job (mint-with-rejection against the index); a mint may repeat.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§