pub struct SurfaceFeature(/* private fields */);Expand description
A capability a surface must have to present some part of an interaction: accepting secret input without echoing it, rendering a diagram, showing more than one control at once.
A named string rather than a closed enum, on purpose. This is a WIRE vocabulary: a v2 document may demand a feature this build has never heard of, and a closed enum could not even represent it — the name would be lost at parse time and law 5 would have nothing left to act on. Carrying the name verbatim is what lets an unknown demand be refused (when required) or reported (when optional) instead of silently vanishing.
Implementations§
Source§impl SurfaceFeature
impl SurfaceFeature
Sourcepub const SECRET_INPUT: &'static str = "secret-input"
pub const SECRET_INPUT: &'static str = "secret-input"
The surface accepts secret input without echoing or persisting it.
Sourcepub const DIAGRAMS: &'static str = "diagrams"
pub const DIAGRAMS: &'static str = "diagrams"
The surface renders a diagram extension (epic slice E0).
Sourcepub const MULTI_CONTROL: &'static str = "multi-control"
pub const MULTI_CONTROL: &'static str = "multi-control"
The surface can present more than one control at once.
Sourcepub fn new(name: impl Into<String>) -> Result<Self, ProtocolError>
pub fn new(name: impl Into<String>) -> Result<Self, ProtocolError>
Adopt a feature name.
§Errors
ProtocolError::InvalidId when empty. An UNRECOGNIZED name is
not an error — that is the forward-compatibility case, and
is_known is how a consumer asks.