pub struct FieldControlOptions { /* private fields */ }Expand description
Everything a field-aware control tells FieldMeta::attributes_for about itself.
Overrides are resolved before any attribute is built, so an overridden state is never emitted twice and never has to be filtered back out of the result.
let options = FieldControlOptions::new()
.required(Some(true))
.name(Some(Rc::from("terms")))
.surface(FieldSurface::BUTTON_WIDGET);Implementations§
Source§impl FieldControlOptions
impl FieldControlOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates options that override nothing and render onto FieldSurface::NATIVE.
Sourcepub fn state(self, state: FieldStateOverrides) -> Self
pub fn state(self, state: FieldStateOverrides) -> Self
Replaces the whole state override set.
Sourcepub fn id(self, id: Option<Rc<str>>) -> Self
pub fn id(self, id: Option<Rc<str>>) -> Self
Overrides the metadata’s control id.
This replaces the emitted value; it does not suppress the attribute. id is a global
attribute, so there is no element that must not carry one.
Sourcepub fn name(self, name: Option<Rc<str>>) -> Self
pub fn name(self, name: Option<Rc<str>>) -> Self
Overrides the metadata’s control name.
This replaces the emitted value. To suppress the attribute on an element that cannot carry
it, set FieldSurface::name to NameSurface::Omit instead.
Sourcepub fn surface(self, surface: FieldSurface) -> Self
pub fn surface(self, surface: FieldSurface) -> Self
Declares how the rendered element spells each field attribute.
Trait Implementations§
Source§impl Clone for FieldControlOptions
impl Clone for FieldControlOptions
Source§fn clone(&self) -> FieldControlOptions
fn clone(&self) -> FieldControlOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more