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§
Sourcefn resolve<M: Metadata + ?Sized>(self, metadata: &M) -> Option<usize>
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.
Sourcefn describe(&self) -> String
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".