pub enum SelectionReason {
Scored,
Pinned,
Explicit,
Unknown,
}Expand description
Why the host selected this plugin.
Variants§
Scored
It won on evidence: the highest score in the winning family.
Also the default: a hand-built context (in a plugin’s own test) starts from “nothing was pinned and nobody named me”, which is this.
Pinned
The project config pins this plugin’s family to it.
Explicit
The user named it on the command line.
Unknown
A reason this build of the contract does not know.
A newer host may add one, and an older plugin must still run: the reason is information, not something to refuse a call over.
Implementations§
Source§impl SelectionReason
impl SelectionReason
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The word this reason is called by, for a plugin’s own messages.
Sourcepub const fn to_abi(self) -> u32
pub const fn to_abi(self) -> u32
The number this reason crosses the boundary as.
SelectionReason::Unknown has none of its own – it means “this build does not know that
reason” and only ever comes from a host – so it answers with the neutral
PMPX_REASON_SCORED.