Skip to main content

Singular

Trait Singular 

Source
pub trait Singular:
    Send
    + Sync
    + FetchBytes {
    // Required method
    fn hash(&self) -> Hash;

    // Provided method
    fn parse_checked<T: FullHash, E: ExtraFor<T>>(
        &self,
        data: &[u8],
        resolve: &Arc<dyn Resolve>,
        extra: &E,
    ) -> Result<T>
       where Self: Sized { ... }
}

Required Methods§

Source

fn hash(&self) -> Hash

Provided Methods§

Source

fn parse_checked<T: FullHash, E: ExtraFor<T>>( &self, data: &[u8], resolve: &Arc<dyn Resolve>, extra: &E, ) -> Result<T>
where Self: Sized,

Trait Implementations§

Source§

impl InlineOutput for dyn Singular + '_

Source§

impl ListHashes for dyn Singular + '_

Source§

fn list_hashes(&self, f: &mut (impl ?Sized + FnMut(Hash)))

[Hash]-only part of Topological::traverse.
Source§

fn point_count(&self) -> usize

How many others this object refers to.
Source§

fn topology_hash(&self) -> Hash

[Hash] of all [Hash]es the object refers to other objects by.
Source§

impl ToOutput for dyn Singular + '_

Source§

fn to_output(&self, output: &mut (impl ?Sized + Output))

Provide object’s byte representation to an Output.
Source§

fn hasher(&self) -> Sha256

Return a Sha256 hasher pre-filled with data of this object.
Source§

fn data_hash(&self) -> Hash

[Hash] of (real, i.e. serialized) data of this object.
Source§

fn mangle_hash(&self) -> Hash

“Mangle hash” of the object. This is used to introduce runtime distinction between data-identical objects similarly to compile-time Tagged::HASH.
Source§

fn output<T: FromOutput<Output: Default>>(&self) -> T

Construct an Output, possibly finalising it afterwards. Read more
Source§

fn vec(&self) -> Vec<u8>

Collect this object’s data (serialize the object).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: ?Sized + Singular> Singular for Arc<T>

Source§

fn hash(&self) -> Hash

Implementors§