pub struct EntityForm(/* private fields */);Expand description
A form of an entity in a window. It checks its rules and hands the record over: keeping it is up to whoever asked, so a record with rules of its own keeps going through them. A handle.
Implementations§
Source§impl EntityForm
impl EntityForm
Sourcepub fn new<S: ObjectSpace + 'static>(
entity: &str,
entities: Vec<EntityInfo>,
space: impl Fn() -> S + 'static,
words: Words,
editors: EditorRegistry,
) -> Result<Self, ModelError>
pub fn new<S: ObjectSpace + 'static>( entity: &str, entities: Vec<EntityInfo>, space: impl Fn() -> S + 'static, words: Words, editors: EditorRegistry, ) -> Result<Self, ModelError>
A form of this entity, among these. References find their records in space.
Sourcepub fn on_save(self, handler: impl Fn(&Object, bool) -> bool + 'static) -> Self
pub fn on_save(self, handler: impl Fn(&Object, bool) -> bool + 'static) -> Self
Takes a record that met its rules, and whether it is new; false leaves the form open.
Sourcepub fn scrolling_height(self, height: f32) -> Self
pub fn scrolling_height(self, height: f32) -> Self
Scrolls its fields inside this height.
Sourcepub fn captions(self, caption: FormCaption) -> Self
pub fn captions(self, caption: FormCaption) -> Self
Says what a field is called when that depends on the record.
Sourcepub fn start_new(&self, text: FormText, fill: impl FnOnce(&mut Object))
pub fn start_new(&self, text: FormText, fill: impl FnOnce(&mut Object))
Opens on a new record, filled in by fill.
Sourcepub fn start_edit(
&self,
text: FormText,
key: &Value,
fill: impl FnOnce(&mut Object),
)
pub fn start_edit( &self, text: FormText, key: &Value, fill: impl FnOnce(&mut Object), )
Opens on the record with this key, changed by fill first. Nothing happens if it is gone.
Trait Implementations§
Source§impl Clone for EntityForm
impl Clone for EntityForm
Source§fn clone(&self) -> EntityForm
fn clone(&self) -> EntityForm
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EntityForm
impl Debug for EntityForm
Auto Trait Implementations§
impl !RefUnwindSafe for EntityForm
impl !Send for EntityForm
impl !Sync for EntityForm
impl !UnwindSafe for EntityForm
impl Freeze for EntityForm
impl Unpin for EntityForm
impl UnsafeUnpin for EntityForm
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Adds padding inside the box, in logical pixels.
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Paints a background behind the content.
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
Fixes the width and/or height in logical pixels;
None keeps the content size.