Skip to main content

Resolve

Trait Resolve 

Source
pub trait Resolve:
    Send
    + Sync
    + AsAny {
    // Required methods
    fn resolve<'a>(
        &'a self,
        address: Address,
        this: &'a Arc<dyn Resolve>,
    ) -> FailFuture<'a, ByteNode>;
    fn resolve_data(&self, address: Address) -> FailFuture<'_, Vec<u8>>;

    // Provided methods
    fn try_resolve_local(
        &self,
        address: Address,
        this: &Arc<dyn Resolve>,
    ) -> Result<Option<ByteNode>> { ... }
    fn topology_hash(&self) -> Option<Hash> { ... }
    fn into_topovec(self: Arc<Self>) -> Option<TopoVec> { ... }
}
Expand description

Something that can resolve Addresses to ByteNodes.

Required Methods§

Source

fn resolve<'a>( &'a self, address: Address, this: &'a Arc<dyn Resolve>, ) -> FailFuture<'a, ByteNode>

Resolve the address. For an Object, this is what gets used as PointInput.

this points to same thing as self. Provided for ease of cloning [Hash]-based Resolves.

Source

fn resolve_data(&self, address: Address) -> FailFuture<'_, Vec<u8>>

Resolve data only (without a nested Resolve).

Provided Methods§

Source

fn try_resolve_local( &self, address: Address, this: &Arc<dyn Resolve>, ) -> Result<Option<ByteNode>>

Attempt resolving assuming something is local. Returns None when it’s not known to be local.

Source

fn topology_hash(&self) -> Option<Hash>

Topology hash of the underyling sequence if this resolver is index-based.

Source

fn into_topovec(self: Arc<Self>) -> Option<TopoVec>

Attempt unwrapping a TopoVec. Generally shouldn’t be implemented.

Trait Implementations§

Source§

impl InlineOutput for dyn Resolve + '_

Source§

impl ListHashes for dyn Resolve + '_

Source§

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

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

fn topology_hash(&self) -> Hash

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

fn point_count(&self) -> usize

How many others this object refers to.
Source§

impl MaybeHasNiche for dyn Resolve + '_

Source§

type MnArray = NoNiche<ZeroNoNiche<<dyn Resolve + '_ as Size>::Size>>

Should implement [MnArray]. Not constraint explicitly, because that breaks things.
Source§

impl Size for dyn Resolve + '_

Source§

impl Tagged for dyn Resolve + '_

Source§

const TAGS: Tags = _

Source§

const HASH: Hash = _

Source§

impl ToOutput for dyn Resolve + '_

No-op matching the ParseInline.

Source§

fn to_output(&self, _: &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".

Implementors§