Skip to main content

Submit

Trait Submit 

Source
pub trait Submit<R: Resource>: Sized {
    // Required methods
    fn action_id(&self) -> &'static str;
    fn into_invoke(self) -> Result<Invoke<R>, String>;

    // Provided method
    fn control_binding(self, actions: &Actions<R>) -> Option<ActionBinding<()>> { ... }
}
Expand description

Something a dispatcher submits and a button is bound to: a field edit made at a path (p.favorite.set(true)), a verb with its arguments, or an invocation built some other way. No app writes an action id or an argument map.

Required Methods§

Source

fn action_id(&self) -> &'static str

The public id of the action this submits.

Source

fn into_invoke(self) -> Result<Invoke<R>, String>

The invocation of the host door this submits.

§Errors

Returns why it cannot be submitted.

Provided Methods§

Source

fn control_binding(self, actions: &Actions<R>) -> Option<ActionBinding<()>>

The binding of a button that submits this when pressed, or None (and a failure in tests) when the resource does not publish it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<P> Submit<<P as Params>::Resource> for FormSubmit<P>
where P: Params, P::Resource: Resource,

Source§

impl<R: Resource> Submit<R> for Edit<R>

Source§

impl<R: Resource> Submit<R> for Invoke<R>