pub struct FormViewSpec<'a> {
pub title: &'a str,
pub subtitle: Option<&'a str>,
pub fields: &'a [FormField],
pub banner: Option<(&'a str, Color32)>,
pub trailing: Option<&'a [(&'a str, Vec<String>)]>,
pub exit_label: &'a str,
pub rollback: bool,
pub hits_prefix: &'a str,
}Expand description
Everything ABOUT the form that the consumer supplies. Borrowed; the form view holds no state of its own beyond egui memory.
Fields§
§title: &'a strThe form’s heading — e.g. "E3 ⟠ Extrude". Also the scope key for this
form’s transient view state and per-field widget ids, so it must be
STABLE and UNIQUE per subject (a feature id / constraint id qualifies).
subtitle: Option<&'a str>An optional second line under the title (a status, a type name…).
fields: &'a [FormField]The schema fields to render, in schema order.
A message banner drawn under the title — e.g. the feature’s run error.
trailing: Option<&'a [(&'a str, Vec<String>)]>Read-only sections appended after the fields — e.g. [("Outputs", …)].
exit_label: &'a strThe bottom button’s label. Both of today’s consumers say “Return to
tree” — the history feature list and the constraint list are BOTH drawn
by panels::tree, so the word is literal, not a metaphor (Q12). A
consumer whose list is NOT a tree supplies its own wording here.
rollback: boolWhether this consumer’s subject lives in a ROLLED history — i.e. whether LEAVING the form also means “roll the model back to the tip”.
The form view holds no engine and therefore cannot roll anything itself
(that is FormViewOut::roll_to_tip, which the caller acts on). What
this flag does is decide, in ONE place, whether an exit carries that
intent — so no consumer has to hard-code “am I the history panel?” at its
exit arm. The history panel passes true; assembly constraints have no
rollback at all (the owner’s call) and pass false, which is why their
panel has no roll branch to get wrong.
hits_prefix: &'a strPrefix for every published hit key. "" for a consumer that shows ONE
form at a time (history); a consumer that can show several at once MUST
pass a prefix carrying the subject id or the rects collide silently.
Auto Trait Implementations§
impl<'a> Freeze for FormViewSpec<'a>
impl<'a> RefUnwindSafe for FormViewSpec<'a>
impl<'a> Send for FormViewSpec<'a>
impl<'a> Sync for FormViewSpec<'a>
impl<'a> Unpin for FormViewSpec<'a>
impl<'a> UnsafeUnpin for FormViewSpec<'a>
impl<'a> UnwindSafe for FormViewSpec<'a>
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> 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<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 more