Skip to main content

WireKey

Trait WireKey 

Source
pub trait WireKey: Sealed {
    // Required methods
    fn resolve<M: Metadata + ?Sized>(self, metadata: &M) -> Option<usize>;
    fn describe(&self) -> String;
}
Expand description

A wire reference — either a pre-resolved index (fast path) or a name (resolved against the context’s input map).

Lets set_wire / get_wire accept either form so callers can hold an index when they have one and a name when they don’t, without needing two distinct method names.

Sealed: only the in-crate impls (usize, &str, String) are valid wire keys. External implementors are not permitted because the resolution semantics are tied to the context’s input layout.

Required Methods§

Source

fn resolve<M: Metadata + ?Sized>(self, metadata: &M) -> Option<usize>

Resolve to a wire index in metadata. Returns None when the key doesn’t match a wire on this context.

Source

fn describe(&self) -> String

Diagnostic rendering of this key — used by Dataflow::set_wire when constructing WriteError::UnknownWire so the error names what the caller passed.

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 WireKey for &String

Source§

fn resolve<M: Metadata + ?Sized>(self, metadata: &M) -> Option<usize>

Source§

fn describe(&self) -> String

Source§

impl WireKey for &str

Source§

fn resolve<M: Metadata + ?Sized>(self, metadata: &M) -> Option<usize>

Source§

fn describe(&self) -> String

Source§

impl WireKey for String

Source§

fn resolve<M: Metadata + ?Sized>(self, metadata: &M) -> Option<usize>

Source§

fn describe(&self) -> String

Source§

impl WireKey for usize

Source§

fn resolve<M: Metadata + ?Sized>(self, _: &M) -> Option<usize>

Source§

fn describe(&self) -> String

Implementors§