Skip to main content

AttributeRead

Trait AttributeRead 

Source
pub trait AttributeRead: SealedAttributeRead {
    type Value: Value;
}
Expand description

Selects one Attribute or AttributeMap instance for Client::get_attributes.

Since 1.31.0.

Attribute<T> and AttributeMapInstance<T> implement this trait. References to them and LazyLock statics that hold them also implement it. Create an AttributeMapInstance with AttributeMap::instance. Applications cannot implement this trait. See Client::get_attributes for an example.

An AttributeMapLoad from AttributeMap::load is not a read, so it does not compile:

ⓘ
use dex_sdk::{AttributeMap, Client};

fn read_note(client: &Client, notes: &AttributeMap<String>) -> dex_sdk::SdkResult<()> {
    client.get_attributes("order-1", (&notes.load("n1"),))?;
    Ok(())
}

Required Associated Types§

Source

type Value: Value

The decoded value type of the selected Attribute or AttributeMap instance.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<Read: AttributeRead, Init: FnOnce() -> Read> AttributeRead for LazyLock<Read, Init>

Source§

impl<Read: AttributeRead> AttributeRead for &Read

Implementors§