Skip to main content

SubmitForm

Struct SubmitForm 

Source
pub struct SubmitForm<M: Model, A: Action> { /* private fields */ }
Expand description

Form with a submit action attached.

Implementations§

Source§

impl<M: Model, A: Action> SubmitForm<M, A>

Source

pub fn on_success( self, handler: impl Fn(&A::Output, &mut UiCtx) + Send + Sync + 'static, ) -> Self

What happens after a successful save.

Source

pub fn success_effects(&self, output: &A::Output) -> Vec<Effect>

Effects produced after a successful save.

Source

pub fn form(&self) -> &Form<M>

Trait Implementations§

Source§

impl<M: Model, A> Component for SubmitForm<M, A>
where A: Action<Input = Valid<M>>, A::Output: Outcome,

Source§

fn render(&self, out: &mut String, r: &Render<'_>)

Source§

fn schema(&self) -> Json

Schema used by MCP tools and test generation. Include a "type" key.
Source§

fn form(&self) -> Option<&dyn FormSource>

Source§

fn reveal(&self, field: &str) -> Option<Revealed>

The raw value of a masked field this component shows, for an audited reveal. The server checks the unmask permission before sending it.
Source§

fn source(&self, key: &str) -> Option<&dyn DataSource>

Data the component fetches through an action, by key (a field name for lookups).
Source§

fn grid(&self) -> Option<&dyn GridSource>

Source§

fn import(&self) -> Option<&dyn ImportSource>

CSV import, for components that import rows (see crate::Import).
Source§

fn children(&self) -> &[Node]

Nodes held by a container. Child i of the node at path p has the path p.i.
Source§

fn eager_children(&self) -> &[Node]

Children rendered with the page. Others, such as closed lazy tabs, load when first shown.
Source§

fn shortcuts(&self) -> Vec<&str>

Keyboard shortcuts of the component’s own links, as declared, for the clash checks of App::check and App::check_page.
Source§

impl<M: Model, A> DataSource for SubmitForm<M, A>
where A: Action<Input = Valid<M>>, A::Output: Outcome,

Checks one step of a stepped form: reads every submitted value the way a save would and returns the errors of the step’s fields only. Nothing is saved; the submit action’s permission is required, as for saving.

Source§

fn action(&self) -> ActionMeta

Source§

fn fetch(&self, ctx: Ctx, input: Json) -> BoxFuture<Result<Json>>

Runs the action with the client’s input. The input is untrusted: it is read as the action’s input type, and anything that does not fit is refused.
Source§

impl<M: Model, A> FormSource for SubmitForm<M, A>
where A: Action<Input = Valid<M>>, A::Output: Outcome,

Source§

fn action(&self) -> ActionMeta

Source§

fn submit( &self, ctx: Ctx, values: Map<String, Json>, ) -> BoxFuture<Result<Vec<Effect>>>

Parses submitted values, validates and runs the action. values holds what the user typed.
Source§

fn tool_schema(&self) -> Json

JSON Schema of the values, for agent tools.
Source§

impl<M: Model, A> From<SubmitForm<M, A>> for Node
where A: Action<Input = Valid<M>>, A::Output: Outcome,

Source§

fn from(f: SubmitForm<M, A>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<M, A> !RefUnwindSafe for SubmitForm<M, A>

§

impl<M, A> !UnwindSafe for SubmitForm<M, A>

§

impl<M, A> Freeze for SubmitForm<M, A>
where Form<M>: Freeze, Option<Arc<dyn Fn(&<A as Action>::Output, &mut UiCtx) + Sync + Send>>: Freeze, PhantomData<fn() -> A>: Freeze,

§

impl<M, A> Send for SubmitForm<M, A>
where Form<M>: Send, Option<Arc<dyn Fn(&<A as Action>::Output, &mut UiCtx) + Sync + Send>>: Send, PhantomData<fn() -> A>: Send,

§

impl<M, A> Sync for SubmitForm<M, A>
where Form<M>: Sync, Option<Arc<dyn Fn(&<A as Action>::Output, &mut UiCtx) + Sync + Send>>: Sync, PhantomData<fn() -> A>: Sync,

§

impl<M, A> Unpin for SubmitForm<M, A>
where Form<M>: Unpin, Option<Arc<dyn Fn(&<A as Action>::Output, &mut UiCtx) + Sync + Send>>: Unpin, PhantomData<fn() -> A>: Unpin,

§

impl<M, A> UnsafeUnpin for SubmitForm<M, A>
where Form<M>: UnsafeUnpin, Option<Arc<dyn Fn(&<A as Action>::Output, &mut UiCtx) + Sync + Send>>: UnsafeUnpin, PhantomData<fn() -> A>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more