Skip to main content

Source

Trait Source 

Source
pub trait Source {
    type Id: Copy + Eq + HashWork;
    type Document: Copy + Eq;
    type Generation: Copy + Eq;

    // Required method
    fn snapshot(&self) -> Snapshot<Self::Document, Self::Generation>;
}
Expand description

A source owner’s stable identities, independent of its document model.

An XML owner implements it over element identities, a CMS or PDF owner over its own attribute, object or revision identities. Nothing here reads the source; long-term validation only compares identities and generations.

Required Associated Types§

Source

type Id: Copy + Eq + HashWork

Stable node identity scoped to this document, independent of a borrow. Its trusted HashWork bound covers all hashing/equality bytes so identity indexes can admit their complete work before querying attacker input.

Source

type Document: Copy + Eq

Stable document identity.

Source

type Generation: Copy + Eq

Exact document generation.

Required Methods§

Source

fn snapshot(&self) -> Snapshot<Self::Document, Self::Generation>

Returns identity/generation in constant time, without allocation or I/O.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§