pub struct ChoiceOptions<'a> { /* private fields */ }Expand description
Writer for a choice options array.
This struct is created by Field::choice_options.
Implementations§
Source§impl ChoiceOptions<'_>
impl ChoiceOptions<'_>
Sourcepub fn option(&mut self, value: impl TextStrLike) -> &mut Self
pub fn option(&mut self, value: impl TextStrLike) -> &mut Self
Add an option with the given value.
Sourcepub fn options(
&mut self,
values: impl IntoIterator<Item = impl TextStrLike>,
) -> &mut Self
pub fn options( &mut self, values: impl IntoIterator<Item = impl TextStrLike>, ) -> &mut Self
Add options with the given values.
Sourcepub fn export(
&mut self,
value: impl TextStrLike,
export_value: TextStr<'_>,
) -> &mut Self
pub fn export( &mut self, value: impl TextStrLike, export_value: TextStr<'_>, ) -> &mut Self
Add an option with the given value and export value.
Sourcepub fn exports<'b>(
&mut self,
values: impl IntoIterator<Item = (impl TextStrLike, TextStr<'b>)>,
) -> &mut Self
pub fn exports<'b>( &mut self, values: impl IntoIterator<Item = (impl TextStrLike, TextStr<'b>)>, ) -> &mut Self
Add options with the given pairs of value and export value.
Methods from Deref<Target = Array<'a>>§
Sourcepub fn item<T: Primitive>(&mut self, value: T) -> &mut Self
pub fn item<T: Primitive>(&mut self, value: T) -> &mut Self
Write an item with a primitive value.
This is a shorthand for array.push().primitive(value).
Sourcepub fn items<T: Primitive>(
&mut self,
values: impl IntoIterator<Item = T>,
) -> &mut Self
pub fn items<T: Primitive>( &mut self, values: impl IntoIterator<Item = T>, ) -> &mut Self
Write a sequence of items with primitive values.
Trait Implementations§
Source§impl<'a> Deref for ChoiceOptions<'a>
impl<'a> Deref for ChoiceOptions<'a>
Source§impl<'a> DerefMut for ChoiceOptions<'a>
impl<'a> DerefMut for ChoiceOptions<'a>
Source§impl<'a, 'any> Rewrite<'a> for ChoiceOptions<'any>
impl<'a, 'any> Rewrite<'a> for ChoiceOptions<'any>
Source§type Output = ChoiceOptions<'a>
type Output = ChoiceOptions<'a>
The writer with the rewritten lifetime.
Auto Trait Implementations§
impl<'a> Freeze for ChoiceOptions<'a>
impl<'a> RefUnwindSafe for ChoiceOptions<'a>
impl<'a> Send for ChoiceOptions<'a>
impl<'a> Sync for ChoiceOptions<'a>
impl<'a> Unpin for ChoiceOptions<'a>
impl<'a> !UnwindSafe for ChoiceOptions<'a>
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