pub struct NodeFieldAttrs {
pub label: Option<Arc<str>>,
pub editor: EditorKind,
pub bound_input: Option<Arc<str>>,
pub description: Option<Arc<str>>,
pub visible_when: VisibleWhen,
}Expand description
Field-level metadata — declared once per reflected struct field and
consumed both by the host’s PropDef-style binding type (which
folds these into the property store) and by the property panel
when it renders the field’s editor + label.
Fields§
§label: Option<Arc<str>>§editor: EditorKind§bound_input: Option<Arc<str>>When Some(socket_name), the field is paired with the input
socket of that name (host-side concept): the canvas draws the
field’s inline editor on the socket’s row, and the editor is
hidden when the socket is connected. Hosts without an input-
socket concept ignore this.
description: Option<Arc<str>>Free-text description shown in tooltips / the property-panel
detail view. MatterCAD’s [Description("…")].
visible_when: VisibleWhenVisibility gate — Always, AdvancedOn, AdvancedOff, or Never. The UI filters rows by combining this with the live “advanced” toggle value.
Implementations§
Source§impl NodeFieldAttrs
impl NodeFieldAttrs
pub fn new() -> Self
pub fn with_label(self, label: impl Into<Arc<str>>) -> Self
pub fn with_editor(self, editor: EditorKind) -> Self
pub fn bound_to(self, socket: impl Into<Arc<str>>) -> Self
pub fn with_description(self, text: impl Into<Arc<str>>) -> Self
Sourcepub fn visible_when(self, when: VisibleWhen) -> Self
pub fn visible_when(self, when: VisibleWhen) -> Self
Set the conditional visibility gate. Same trio as MatterCAD’s
[HideFromEditor] + IPropertyGridModifier.UpdateControls.
Sourcepub fn advanced(self) -> Self
pub fn advanced(self) -> Self
Shorthand for visible_when(VisibleWhen::AdvancedOn) — the
common case of “this row is only relevant after the user opens
Advanced”.
Sourcepub fn easy_only(self) -> Self
pub fn easy_only(self) -> Self
Shorthand for visible_when(VisibleWhen::AdvancedOff) — used
by easy-mode hint messages that disappear once Advanced is on.
Shorthand for visible_when(VisibleWhen::Never).
Trait Implementations§
Source§impl Clone for NodeFieldAttrs
impl Clone for NodeFieldAttrs
Source§fn clone(&self) -> NodeFieldAttrs
fn clone(&self) -> NodeFieldAttrs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NodeFieldAttrs
impl Debug for NodeFieldAttrs
Source§impl Default for NodeFieldAttrs
impl Default for NodeFieldAttrs
Source§fn default() -> NodeFieldAttrs
fn default() -> NodeFieldAttrs
Auto Trait Implementations§
impl Freeze for NodeFieldAttrs
impl RefUnwindSafe for NodeFieldAttrs
impl Send for NodeFieldAttrs
impl Sync for NodeFieldAttrs
impl Unpin for NodeFieldAttrs
impl UnsafeUnpin for NodeFieldAttrs
impl UnwindSafe for NodeFieldAttrs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().