Struct splinter::registry::UnifiedRegistry[][src]

pub struct UnifiedRegistry { /* fields omitted */ }
Expand description

A registry with multiple sources.

The UnifiedRegistry provides a unified view of multiple source registries. It has one internal read-write registry and an arbitrary number of external read-only registries.

Writing

All write operations (provided by the implementation of the RegistryWriter trait) affect only the internal read-write registry.

Reading

Read operations (provided by the RegistryReader implementation) provide Node data from all source registries.

If a Node exists in more than one registry (nodes are considered duplicates if they have the same identity), then the definition of the Node from the registry with the highest precedence is used, with the exception of the node’s metadata (see the Metadata Merging section below).

If reading a source registry fails, the error will be logged and the registry will be ignored.

Registry Precedence

The internal read-write registry has the highest precedence, followed by the read-only registries. The precedence of the read-only registries is based on the order they appear (the earlier in the list, the higher the priority).

Metadata Merging

When the same node exists in multiple registries, the metadata is merged from all sources. If the same metadata key is set for the node in different registires, the value for that key from the highest-precedence registry will be used.

Implementations

Constructs a new UnifiedRegistry with an internal read-write registry and an arbitrary number of read-only registries.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns an iterator over the nodes in the registry. Read more

Returns the count of nodes in the registry. Read more

Returns the node with the given identity, if it exists in the registry. Read more

Determines whether or not the node exists in the registry. Read more

Adds a new node to the registry. Read more

Replaces an existing node with the same identity. Read more

Deletes a node with the given identity and returns the node if it was in the registry. Read more

Clone implementation for RwRegistry. The implementation of the Clone trait for Box<RwRegistry> calls this method. Read more

Clone the RwRegistry as a Box<dyn RegistryReader>.

Clone the RwRegistry as a Box<dyn RegistryWriter>.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Convert self to an expression for Diesel’s query builder. Read more

Convert &self to an expression for Diesel’s query builder. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.