pub struct State<Id> { /* private fields */ }property-grid only.Expand description
The properties, their values, and what is open, highlighted, filtered and being edited.
Implementations§
Source§impl<Id: Copy + Eq + Hash> State<Id>
impl<Id: Copy + Eq + Hash> State<Id>
Sourcepub fn new(properties: impl IntoIterator<Item = Property<Id>>) -> Self
pub fn new(properties: impl IntoIterator<Item = Property<Id>>) -> Self
Holds properties, categorised with every category open. Ids must
be unique; a later property with the same id replaces the earlier.
pub fn with_sort(self, sort: Sort) -> Self
Sourcepub fn with_collapsed(
self,
categories: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_collapsed( self, categories: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Starts with these categories closed.
Sourcepub fn with_name_width(self, width: f32) -> Self
pub fn with_name_width(self, width: f32) -> Self
Starts the name column at width pixels rather than
NAME_WIDTH, which a narrow grid shrinks.
Sourcepub fn properties(&self) -> &[Property<Id>]
pub fn properties(&self) -> &[Property<Id>]
Every property, in the order given.
pub fn property(&self, id: Id) -> Option<&Property<Id>>
pub fn value(&self, id: Id) -> Option<&Value>
Sourcepub fn set(&mut self, id: Id, value: impl Into<Value>) -> bool
pub fn set(&mut self, id: Id, value: impl Into<Value>) -> bool
Sets a value from the app, such as after an undo or from a custom editor, dropping any draft or edit of it. Returns whether it changed.
Sourcepub fn categories(&self) -> &[String]
pub fn categories(&self) -> &[String]
Category names, in the order they first appear.
pub fn is_expanded(&self, category: &str) -> bool
pub fn sort(&self) -> Sort
Sourcepub fn highlighted(&self) -> Option<&Entry<Id>>
pub fn highlighted(&self) -> Option<&Entry<Id>>
The row the keyboard acts on, which the description area describes.
Sourcepub fn highlighted_property(&self) -> Option<&Property<Id>>
pub fn highlighted_property(&self) -> Option<&Property<Id>>
The highlighted property, if a property rather than a category is highlighted.
Sourcepub fn draft(&self, id: Id) -> Option<&Draft>
pub fn draft(&self, id: Id) -> Option<&Draft>
Text typed into a property that is being edited, or that was left while invalid.
Sourcepub fn can_reset(&self, id: Id) -> bool
pub fn can_reset(&self, id: Id) -> bool
Whether resetting the property would change anything: it has a default, is enabled, and differs from the default or holds a draft.
pub fn is_focused(&self) -> bool
Sourcepub fn is_resizing(&self) -> bool
pub fn is_resizing(&self) -> bool
Whether the line between the columns is being dragged.
Sourcepub fn name_width(&self) -> Option<f32>
pub fn name_width(&self) -> Option<f32>
The name column’s width once set or dragged.
Sourcepub fn count(&self, category: &str) -> usize
pub fn count(&self, category: &str) -> usize
How many properties in a category pass the filter.
Sourcepub fn entries(&self) -> Vec<Entry<Id>>
pub fn entries(&self) -> Vec<Entry<Id>>
The rows on screen, in order: properties that pass the filter, under their categories while categorised.
Trait Implementations§
Auto Trait Implementations§
impl<Id> Freeze for State<Id>
impl<Id> RefUnwindSafe for State<Id>where
Vec<Property<Id>>: RefUnwindSafe,
HashMap<Id, usize>: RefUnwindSafe,
Option<Entry<Id>>: RefUnwindSafe,
Option<Editing<Id>>: RefUnwindSafe,
HashMap<Id, Draft>: RefUnwindSafe,
impl<Id> Send for State<Id>
impl<Id> Sync for State<Id>
impl<Id> Unpin for State<Id>
impl<Id> UnsafeUnpin for State<Id>where
Vec<Property<Id>>: UnsafeUnpin,
HashMap<Id, usize>: UnsafeUnpin,
Option<Entry<Id>>: UnsafeUnpin,
Option<Editing<Id>>: UnsafeUnpin,
HashMap<Id, Draft>: UnsafeUnpin,
impl<Id> UnwindSafe for State<Id>where
Vec<Property<Id>>: UnwindSafe,
HashMap<Id, usize>: UnwindSafe,
Option<Entry<Id>>: UnwindSafe,
Option<Editing<Id>>: UnwindSafe,
HashMap<Id, Draft>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>. 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>
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)
&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> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.