Skip to main content

WriteAttrSpec

Trait WriteAttrSpec 

Source
pub trait WriteAttrSpec<'a>: Sized {
    type Output;
    type ReadNames;
    type ReadSpec;

    // Required methods
    fn into_values(self) -> Vec<Named<Value>>;
    fn collect(writes: Vec<Result<()>>) -> Result<Self::Output>;
}
Expand description

The values to write to one or many attributes, see DevProxy::write_attr.

Supporting trait: it is only there to make this crate’s API easier to use, it is implemented for everything that API accepts and is not one to implement anywhere else.

Required Associated Types§

Source

type Output

The final type of the output.

Source

type ReadNames

Names for the read specification type.

Source

type ReadSpec

The read specification type, for when using write_read_attr.

Required Methods§

Source

fn into_values(self) -> Vec<Named<Value>>

Make this write specification into the values it represents, each with the name of its attribute.

Source

fn collect(writes: Vec<Result<()>>) -> Result<Self::Output>

Build the output out of the outcomes of the write, which come in the order the values were given: a write answers one outcome per value and names nothing back, see DevProxy::write_attr_async.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<'a, A: IntoValue, B: IntoValue, C: IntoValue, D: IntoValue, E: IntoValue, F: IntoValue> WriteAttrSpec<'a> for ((&'a str, A), (&'a str, B), (&'a str, C), (&'a str, D), (&'a str, E), (&'a str, F))

Source§

impl<'a, A: IntoValue, B: IntoValue, C: IntoValue, D: IntoValue, E: IntoValue> WriteAttrSpec<'a> for ((&'a str, A), (&'a str, B), (&'a str, C), (&'a str, D), (&'a str, E))

Source§

impl<'a, A: IntoValue, B: IntoValue, C: IntoValue, D: IntoValue> WriteAttrSpec<'a> for ((&'a str, A), (&'a str, B), (&'a str, C), (&'a str, D))

Source§

impl<'a, A: IntoValue, B: IntoValue, C: IntoValue> WriteAttrSpec<'a> for ((&'a str, A), (&'a str, B), (&'a str, C))

Source§

impl<'a, A: IntoValue, B: IntoValue> WriteAttrSpec<'a> for ((&'a str, A), (&'a str, B))

Source§

impl<'a, A: IntoValue> WriteAttrSpec<'a> for ((&'a str, A),)

Source§

impl<'a, T: IntoValue, const N: usize> WriteAttrSpec<'a> for [(&'a str, T); N]

For an array of attributes.

Source§

impl<'a, T: IntoValue> WriteAttrSpec<'a> for (&'a str, T)

For a single attribute.

Source§

impl<'a, T: IntoValue> WriteAttrSpec<'a> for Vec<(&'a str, T)>

For a vector of attributes.

Implementors§