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>) -> FormField
pub fn password(name: impl Into<String>, label: impl Into<String>) -> FormField
A masked password/secret field.
Sourcepub fn text(name: impl Into<String>, label: impl Into<String>) -> FormField
pub fn text(name: impl Into<String>, label: impl Into<String>) -> FormField
A plain text field.
Sourcepub fn with_placeholder(self, placeholder: impl Into<String>) -> FormField
pub fn with_placeholder(self, placeholder: impl Into<String>) -> FormField
Set placeholder text.
Sourcepub fn with_help(self, help_text: impl Into<String>) -> FormField
pub fn with_help(self, help_text: impl Into<String>) -> FormField
Set help text shown below the input.
Sourcepub fn with_default(self, default_value: impl Into<String>) -> FormField
pub fn with_default(self, default_value: impl Into<String>) -> FormField
Set a default value the form pre-fills.
Trait Implementations§
Source§impl Serialize for FormField
impl Serialize for FormField
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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