SecureField

Struct SecureField 

Source
pub struct SecureField(/* private fields */);
Expand description

A secure text entry field for passwords and sensitive data.

SecureField masks input and securely stores values with automatic memory zeroing.

§Layout Behavior

SecureField expands horizontally to fill available space, but has a fixed height. In an HStack, it will take up all remaining width after other views are sized.

Implementations§

Source§

impl SecureField

Source

pub fn new(label: impl View, value: &Binding<Secure>) -> Self

Creates a new SecureField instance.

§Arguments
  • label - A view representing the label for the secure field.
  • value - A binding to the Secure value that the field will edit.
§Returns

A new SecureField instance configured with the provided label and value binding.

Source

pub fn label(self, label: impl View) -> Self

Sets the label for the secure field.

§Arguments
  • label - A view representing the new label for the secure field.
§Returns

A new SecureField instance with the updated label.

Trait Implementations§

Source§

impl ConfigurableView for SecureField

Source§

type Config = SecureFieldConfig

The configuration type associated with this view. Read more
Source§

fn config(self) -> Self::Config

Returns the configuration for this view. Read more
Source§

impl From<SecureFieldConfig> for SecureField

Source§

fn from(value: SecureFieldConfig) -> Self

Converts to this type from the input type.
Source§

impl View for SecureField

Source§

fn body(self, env: &Environment) -> impl View

Build this view and return the content. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> IdentifiableExt for T

Source§

fn use_id<F, Id>(self, f: F) -> UseId<Self, F>
where F: Fn(&Self) -> Id, Id: Ord + Hash,

Wraps the value in a UseId with the provided identification function.
Source§

fn self_id(self) -> SelfId<Self>

Wraps the value in a SelfId, making the value serve as its own identifier.
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<V> IntoView for V
where V: View,

Source§

type Output = V

The resulting View type after conversion.
Source§

fn into_view(self, _env: &Environment) -> <V as IntoView>::Output

Converts the implementing type into a View. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.