Struct splinter::registry::LocalYamlRegistry[][src]

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

A local, read/write registry.

The LocalYamlRegistry provides access to and modification of a local registry YAML file. The local registry file must be a YAML sequence of nodes, where each node is valid (see Node for validity criteria).

The contents of the YAML file are cached in-memory by the registry; this means that the registry will continue to be available even if the backing YAML file becomes unavailable. Each time the registry is read, it will check the backing file for any changes since the last read and refresh the internal cache if necessary.

On initializaion, the registry will check if its backing file already exists. If the backing file already exists, the registry will attempt to load, parse, and validate it. If the backing file does not already exist, the registry will attempt to create it.

Implementations

Construct a new LocalYamlRegistry. If the backing file already exists, it will be loaded, parsed, and validated; if any of these steps fails, the error will be returned. If the backing file doesn’t already exist, it will be created and initialized; if file creation fails, the error will be returned.

Arguments

  • file_path - The path of the backing YAML file.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

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

Returns the count of nodes 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.