pub struct Posted<F>where
F: RecordForm,{ /* private fields */ }Expand description
An edit submission: the parsed form, and the fields the submission named.
Derefs to the form, so a record fn reads posted.author_id — the posted
value, or the stored one when the submission did not name the field.
Implementations§
Source§impl<F> Posted<F>where
F: RecordForm,
impl<F> Posted<F>where
F: RecordForm,
Sourcepub fn new(
form: F,
named: impl IntoIterator<Item = <F as FormFields>::Field>,
) -> Posted<F>
pub fn new( form: F, named: impl IntoIterator<Item = <F as FormFields>::Field>, ) -> Posted<F>
A posted form that names named.
Sourcepub fn named(
&self,
pick: impl FnOnce(<F as FormFields>::Keys) -> <F as FormFields>::Field,
) -> bool
pub fn named( &self, pick: impl FnOnce(<F as FormFields>::Keys) -> <F as FormFields>::Field, ) -> bool
Whether the submission named field: posted.named(|f| f.post_id).
Sourcepub fn into_update(
self,
record: &mut <F as RecordForm>::Model,
) -> Option<<<F as RecordForm>::Model as Model>::Update<'_>>
pub fn into_update( self, record: &mut <F as RecordForm>::Model, ) -> Option<<<F as RecordForm>::Model as Model>::Update<'_>>
The update builder assigning every named field, or None when the
submission named none. See RecordForm::into_update.
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for Posted<F>
impl<F> RefUnwindSafe for Posted<F>
impl<F> Send for Posted<F>
impl<F> Sync for Posted<F>
impl<F> Unpin for Posted<F>
impl<F> UnsafeUnpin for Posted<F>
impl<F> UnwindSafe for Posted<F>
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