pub struct RepeaterField<F = ()>(/* private fields */);Expand description
A repeater: Field::repeater, or a record form’s #[form(repeat)] control (F is the
form).
Implementations§
Source§impl<F> RepeaterField<F>
impl<F> RepeaterField<F>
pub fn label(self, label: impl Into<String>) -> Self
pub fn name(&self) -> &str
Sourcepub fn visible_when(
self,
watched: &impl Watched<F>,
values: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn visible_when( self, watched: &impl Watched<F>, values: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Shows the field only while watched posts one of values: an option’s value, or
true for a checked toggle. A hidden field posts nothing, so an edit keeps its
stored value and a create takes its blank answer; a field with no blank answer
cannot be conditional.
let kind = Field::choice(Customer::fields().kind()).options(["person", "company"]);
let vat = Field::text(Customer::fields().vat_number()).visible_when(&kind, ["company"]);
Schema::new((kind, vat));Trait Implementations§
Source§impl<F> From<RepeaterField<F>> for Field
impl<F> From<RepeaterField<F>> for Field
Source§fn from(builder: RepeaterField<F>) -> Field
fn from(builder: RepeaterField<F>) -> Field
Converts to this type from the input type.
Source§impl<F> IntoSchema<F> for RepeaterField<F>
impl<F> IntoSchema<F> for RepeaterField<F>
fn into_schema(self) -> Schema<F>
Auto Trait Implementations§
impl<F = ()> !Freeze for RepeaterField<F>
impl<F = ()> !RefUnwindSafe for RepeaterField<F>
impl<F = ()> !UnwindSafe for RepeaterField<F>
impl<F> Send for RepeaterField<F>
impl<F> Sync for RepeaterField<F>
impl<F> Unpin for RepeaterField<F>
impl<F> UnsafeUnpin for RepeaterField<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