pub struct InspectorField {
pub name: String,
pub value: InspectorValue,
pub editable: bool,
pub tooltip: Option<String>,
pub range: Option<(f64, f64)>,
pub step: Option<f64>,
}Expand description
A single named field exposed by an Inspectable object.
Fields§
§name: StringField name / key.
value: InspectorValueCurrent value.
editable: boolWhether the field can be modified via apply_changes.
tooltip: Option<String>Optional tooltip string.
range: Option<(f64, f64)>Numeric range (min, max) for clamping UI sliders.
step: Option<f64>Step size for numeric increment/decrement.
Implementations§
Source§impl InspectorField
impl InspectorField
pub fn new(name: impl Into<String>, value: InspectorValue) -> Self
pub fn editable(self) -> Self
pub fn with_tooltip(self, tip: impl Into<String>) -> Self
pub fn with_range(self, min: f64, max: f64) -> Self
pub fn with_step(self, step: f64) -> Self
pub fn readonly(name: impl Into<String>, value: InspectorValue) -> Self
pub fn read_write(name: impl Into<String>, value: InspectorValue) -> Self
Trait Implementations§
Source§impl Clone for InspectorField
impl Clone for InspectorField
Source§fn clone(&self) -> InspectorField
fn clone(&self) -> InspectorField
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InspectorField
impl RefUnwindSafe for InspectorField
impl Send for InspectorField
impl Sync for InspectorField
impl Unpin for InspectorField
impl UnsafeUnpin for InspectorField
impl UnwindSafe for InspectorField
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
Mutably borrows from an owned value. Read more
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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<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>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> 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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.