pub struct FormField {
pub name: String,
pub label: String,
pub field_type: FieldType,
pub required: bool,
pub placeholder: Option<String>,
pub help_text: Option<String>,
pub default_value: Option<String>,
pub group: Option<String>,
}Expand description
A single form field.
Fields§
§name: StringField name used as the key when submitting (e.g. “api_key”).
label: StringLabel shown next to the input.
field_type: FieldTypeInput type.
required: boolWhether the field is required.
placeholder: Option<String>Placeholder text inside the input.
help_text: Option<String>Help text shown below the input.
default_value: Option<String>Default value the UI pre-fills (e.g. an OAuth scope or AWS region). The stored credential omits unfilled optional fields, so drivers still apply their own defaults; this only seeds the form input.
group: Option<String>Mutually-exclusive group label this field belongs to. Fields sharing a
label are one alternative credential method (e.g. “API key” vs “OAuth”);
ungrouped fields are always part of the credential. None for the
common single-method case.
Implementations§
Source§impl FormField
impl FormField
Sourcepub fn password(name: impl Into<String>, label: impl Into<String>) -> Self
pub fn password(name: impl Into<String>, label: impl Into<String>) -> Self
A masked password/secret field.
Sourcepub fn with_placeholder(self, placeholder: impl Into<String>) -> Self
pub fn with_placeholder(self, placeholder: impl Into<String>) -> Self
Set placeholder text.
Sourcepub fn with_help(self, help_text: impl Into<String>) -> Self
pub fn with_help(self, help_text: impl Into<String>) -> Self
Set help text shown below the input.
Sourcepub fn with_default(self, default_value: impl Into<String>) -> Self
pub fn with_default(self, default_value: impl Into<String>) -> Self
Set a default value the form pre-fills.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FormField
impl RefUnwindSafe for FormField
impl Send for FormField
impl Sync for FormField
impl Unpin for FormField
impl UnsafeUnpin for FormField
impl UnwindSafe for FormField
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request