Skip to main content

NoForm

Struct NoForm 

Source
pub struct NoForm<M>(/* private fields */);
Expand description

The record form of a resource with no create or edit page.

A list-only resource names it as Resource::Form: type Form = NoForm<Self::Model>;. fields and hydrate are empty and into_update answers None. No route parses or writes it, so parse and into_create panic naming the model, and the future exec_update returns panics when polled.

Trait Implementations§

Source§

impl<M: Model + IntoExpr<M> + Send + Sync + 'static> RecordForm for NoForm<M>

Source§

const HAS_FORM: bool = false

Whether the resource naming this form has create and edit pages. Read more
Source§

type Model = M

The model the form writes.
Source§

type Field = !

One variant per form field: the key Posted uses. Its bound form keys are Self::fields’.
Source§

fn fields() -> Vec<FormField<Self::Field>>

Every field, in declaration order, with the keys it binds.
Source§

fn hydrate(_cx: &Cx, _record: &M) -> HashMap<String, String>

The stored record as the form spells it.
Source§

fn parse( _cx: &Cx, _values: &HashMap<String, String>, ) -> Result<Self, Vec<FieldError>>

Parse a completed, normalized submission. Read more
Source§

fn into_create(self) -> M::Create

The create builder with every field set.
Source§

fn into_update<'a>( self, _record: &'a mut M, _named: &HashSet<Self::Field>, ) -> Option<M::Update<'a>>

The instance update builder with one assignment per named field, or None when no field is named. Read more
Source§

fn exec_update<'a>( update: M::Update<'a>, ex: &'a mut dyn Executor, ) -> impl Future<Output = Result<()>> + Send + 'a

Execute a builder Self::into_update returned. Read more
Source§

fn schema() -> Schema

The form’s default schema: one control per field, in declaration order. A ResourceDef without a form renders it. Read more
Source§

fn table() -> Table<Self::Model>

The form’s default table: one column per field a column can show, in declaration order. A ResourceDef without a table lists it. Read more

Auto Trait Implementations§

§

impl<M> Freeze for NoForm<M>
where PhantomData<fn() -> M>: Freeze,

§

impl<M> RefUnwindSafe for NoForm<M>
where PhantomData<fn() -> M>: RefUnwindSafe,

§

impl<M> Send for NoForm<M>
where PhantomData<fn() -> M>: Send,

§

impl<M> Sync for NoForm<M>
where PhantomData<fn() -> M>: Sync,

§

impl<M> Unpin for NoForm<M>
where PhantomData<fn() -> M>: Unpin,

§

impl<M> UnsafeUnpin for NoForm<M>
where PhantomData<fn() -> M>: UnsafeUnpin,

§

impl<M> UnwindSafe for NoForm<M>
where PhantomData<fn() -> M>: UnwindSafe,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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