SecureTextEdit

Struct SecureTextEdit 

Source
pub struct SecureTextEdit<'a> { /* private fields */ }
Expand description

A widget for editing text that is secured by a SecureString.

This widget is identical to egui::TextEdit, but it uses a SecureString instead of a std::string::String.

§Notes

  • Accessability like screen readers is disabled to avoid multiple unsecure allocations of the entered text.
  • If you want to make sure the text you enter doesn’t stay in memory in any way you have to set Self::password to true.

Otherwise egui will make copies of that text and some of the copied allocations will stay in memory.

Implementations§

Source§

impl<'a> SecureTextEdit<'a>

Source

pub fn singleline(text: &'a mut SecureString) -> Self

Source

pub fn multiline(text: &'a mut SecureString) -> Self

Source

pub fn id(self, id: Id) -> Self

Source

pub fn id_source(self, id_source: impl Hash) -> Self

Source

pub fn id_salt(self, id_salt: impl Hash) -> Self

Source

pub fn hint_text(self, hint_text: impl Into<WidgetText>) -> Self

Source

pub fn font(self, font_selection: impl Into<FontSelection>) -> Self

Source

pub fn text_color(self, text_color: Color32) -> Self

Source

pub fn text_color_opt(self, text_color: Option<Color32>) -> Self

Source

pub fn password(self, password: bool) -> Self

Source

pub fn frame(self, frame: bool) -> Self

Source

pub fn margin(self, margin: impl Into<Margin>) -> Self

Source

pub fn interactive(self, interactive: bool) -> Self

Source

pub fn desired_width(self, desired_width: f32) -> Self

Source

pub fn desired_rows(self, desired_height_rows: usize) -> Self

Source

pub fn lock_focus(self, tab_will_indent: bool) -> Self

Source

pub fn cursor_at_end(self, b: bool) -> Self

Source

pub fn min_size(self, min_size: Vec2) -> Self

Source

pub fn horizontal_align(self, align: Align) -> Self

Source

pub fn vertical_align(self, align: Align) -> Self

Source

pub fn clip_text(self, b: bool) -> Self

Source

pub fn char_limit(self, limit: usize) -> Self

Source

pub fn return_key(self, return_key: impl Into<Option<KeyboardShortcut>>) -> Self

Source

pub fn background_color(self, color: Color32) -> Self

Source

pub fn show(self, ui: &mut Ui) -> SecureTextEditOutput

Trait Implementations§

Source§

impl<'a> Widget for SecureTextEdit<'a>

Source§

fn ui(self, ui: &mut Ui) -> Response

Allocate space, interact, paint, and return a Response. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for SecureTextEdit<'a>

§

impl<'a> RefUnwindSafe for SecureTextEdit<'a>

§

impl<'a> Send for SecureTextEdit<'a>

§

impl<'a> Sync for SecureTextEdit<'a>

§

impl<'a> Unpin for SecureTextEdit<'a>

§

impl<'a> !UnwindSafe for SecureTextEdit<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.