pub struct PluginOp {
pub id: String,
pub display_name: String,
pub description: String,
pub kind: i32,
pub params: Vec<ParamSpec>,
pub compatible_focus_types: Vec<i32>,
pub creates_entities: bool,
pub requires_focus: bool,
pub ui: Option<Ui>,
}Expand description
Per-op metadata. User-facing.
Lock semantics (enforced by the orchestrator above the wire):
- compatible_focus_types empty → op runs global; locks globally.
- compatible_focus_types non-empty: focused entity present AND its type ∈ compatible_focus_types → lock just the focused entity (+ create-barrier if creates_entities). otherwise (no focus, or type mismatch) → fall back to global lock, UNLESS requires_focus is set, in which case the op refuses (empty target; button disabled).
- creates_entities → global “create barrier” alongside the focus lock; prevents concurrent create-ops from racing.
Fields§
§id: Stringmagic word, e.g. “wiggle”
display_name: StringUI label, e.g. “Wiggle”
description: Stringtooltip / help text
kind: i32§params: Vec<ParamSpec>empty for click-to-fire ops
compatible_focus_types: Vec<i32>see lock semantics above
creates_entities: boolsee lock semantics above
requires_focus: boolTrue only for ops that genuinely require a focused target (e.g. binder design); the lock model refuses them when no compatible entity is focused. Distinct from compatible_focus_types, which only TYPE-RESTRICTS an optional focus.
ui: Option<Ui>Optional click-to-fire icon. Mutually exclusive with non-empty params
- ops with params render forms, no icon needed.
Implementations§
Source§impl PluginOp
impl PluginOp
Sourcepub fn kind(&self) -> OpKind
pub fn kind(&self) -> OpKind
Returns the enum value of kind, or the default if the field is set to an invalid enum value.
Sourcepub fn compatible_focus_types(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<EntityType>>
pub fn compatible_focus_types( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<EntityType>>
Returns an iterator which yields the valid enum values contained in compatible_focus_types.
Sourcepub fn push_compatible_focus_types(&mut self, value: EntityType)
pub fn push_compatible_focus_types(&mut self, value: EntityType)
Appends the provided enum value to compatible_focus_types.
Trait Implementations§
Source§impl Message for PluginOp
impl Message for PluginOp
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.