Skip to main content

NameStore

Trait NameStore 

Source
pub trait NameStore: Send + Sync {
    // Required methods
    fn get(&self, name: &str) -> Result<Option<NameRecord>, Error>;
    fn put(&self, record: &NameRecord) -> Result<(), Error>;
    fn delete(&self, name: &str) -> Result<bool, Error>;
    fn list(&self) -> Result<Vec<NameRecord>, Error>;

    // Provided methods
    fn describe(&self) -> String { ... }
    fn release_by_vm(&self, microvm_id: &str) -> Result<Vec<String>, Error> { ... }
}
Expand description

Where names are kept. Implement it to keep records in your own database.

Required Methods§

Source

fn get(&self, name: &str) -> Result<Option<NameRecord>, Error>

The record registered under name, or None when the name is free.

Source

fn put(&self, record: &NameRecord) -> Result<(), Error>

Writes record under its name, replacing any earlier record.

Source

fn delete(&self, name: &str) -> Result<bool, Error>

Removes name, answering whether a record was there.

Source

fn list(&self) -> Result<Vec<NameRecord>, Error>

Every readable record, sorted by name.

Provided Methods§

Source

fn describe(&self) -> String

Where this store keeps names, for error messages.

Source

fn release_by_vm(&self, microvm_id: &str) -> Result<Vec<String>, Error>

Removes every name registered to microvm_id and returns them, sorted.

Every match rather than the first: one VM can carry two names in one registry (measured live 2026-09-02: terminating through one alias left the other pointing at a VM that no longer existed).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§