pub trait ToNames: Sized {
// Required method
fn iter_names(&self) -> Option<impl Iterator<Item = &str>>;
// Provided method
fn to_names(self) -> Option<Spectrum<str>> { ... }
}Expand description
Supporting trait for being generic over the different types that can be interpreted as names, either single or many names.
The names are given to a backend as one buffer of strings, which a served device shares in what it answers with, and which a buffer of names already given passes through untouched: names read back from a device, or listed by the database, are given again without being copied.
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 Methods§
Sourcefn iter_names(&self) -> Option<impl Iterator<Item = &str>>
fn iter_names(&self) -> Option<impl Iterator<Item = &str>>
The names, in the order they were given, absent to target all elements, borrowed
where they are: what a request copies into its own parameters, once, rather than
first into a buffer of their own, see Spectrum::from_strs.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".