pub struct FormViewSpec<'a> {
pub title: &'a str,
pub subtitle: Option<&'a str>,
pub fields: &'a [FormField],
pub hidden: Option<&'a HashSet<String>>,
pub banner: Option<(&'a str, Color32)>,
pub trailing: Option<&'a [(&'a str, Vec<String>)]>,
pub extra: Option<(&'a str, &'a dyn Fn(&mut Ui))>,
pub exit_label: &'a str,
pub rollback: bool,
pub hits_prefix: &'a str,
pub read_only: Option<&'a str>,
pub picking: Option<ActivePick<'a>>,
}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.
Field keys (FormField::key) to HIDE this frame — the schema-driven
field-visibility hook. A field whose key is in this set is dropped BEFORE
the fields are partitioned into sections, so a group left with nothing
visible draws no header. None (the common case) hides nothing. A feature
consumer fills this from brep_render::features::feature_hidden_params
against the LIVE params each frame, so it reacts to both first display and
every field change with no extra plumbing.
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", …)].
extra: Option<(&'a str, &'a dyn Fn(&mut Ui))>ONE consumer-drawn section (title, drawer) placed after the schema
groups and before the trailing sections — for a subject whose editing
surface the schema cannot express (a spline’s anchor list). The drawer
is Fn, so anything it decides goes through interior mutability the
consumer owns; the form view stays intent-out like everything else here.
exit_label: &'a strThe exit button’s label — the button at the RIGHT end of the title row.
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.
read_only: Option<&'a str>Why the subject may not change (a PLM revision not checked out, or
released), or None. The fields then draw DISABLED under a banner
saying why, so nothing is typed that the engine would refuse and the
field’s buffer would keep; the exit button stays live.
picking: Option<ActivePick<'a>>The reference field a pick is RUNNING in, when one is — the form draws
it as the focused selection box (form::ActivePick): its button
reads Done, its list is the engine’s running picks and its ✕s come
out as FormViewOut::pick_remove. None draws every reference field
at rest.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for FormViewSpec<'a>
impl<'a> !Send for FormViewSpec<'a>
impl<'a> !Sync for FormViewSpec<'a>
impl<'a> !UnwindSafe for FormViewSpec<'a>
impl<'a> Forget for FormViewSpec<'a>
impl<'a> Freeze for FormViewSpec<'a>
impl<'a> Unpin for FormViewSpec<'a>
impl<'a> UnsafeUnpin 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> 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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.