Skip to main content

RegistryElement

Trait RegistryElement 

Source
pub trait RegistryElement: Serialize + DeserializeOwned {
    // Provided methods
    fn to_element(&self) -> Result<Bytes> { ... }
    fn from_element(element: &[u8]) -> Result<Self> { ... }
}
Expand description

A descriptor as one element of its DHT registry: the element is the descriptor’s codec encoding, carried as is.

Law (round trip): from_element(to_element(d)) = Ok(d).

Provided Methods§

Source

fn to_element(&self) -> Result<Bytes>

This descriptor as a registry element.

Source

fn from_element(element: &[u8]) -> Result<Self>

The descriptor the registry element element encodes.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§