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