Skip to main content

WindowsText

Struct WindowsText 

Source
pub struct WindowsText<'a, 'b> { /* private fields */ }
Expand description

The text of the authentication prompt on Windows, including a title (“caption”) and description (“message”).

Implementations§

Source§

impl<'a, 'b> WindowsText<'a, 'b>

Source

pub const fn new(title: &'a str, description: &'b str) -> Option<Self>

Creates a new WindowsText instance.

On Windows, returns None if title exceeds 128 bytes in length or if description exceeds 1024 bytes in length. On other targets the text is unused, so no validation is performed and this always returns Some.

Examples found in repository?
examples/simple_authentication.rs (line 46)
39const TEXT: Text = Text {
40    android: AndroidText {
41        title: "Title",
42        subtitle: None,
43        description: None,
44    },
45    apple: "authenticate",
46    windows: match WindowsText::new("Title", "Description") {
47        Some(text) => text,
48        None => panic!("Windows text too long"),
49    },
50};
Source

pub fn new_truncated(title: &'a str, description: &'b str) -> Self

Creates a new WindowsText instance.

On Windows, the title (“caption”) is truncated to at most 128 bytes and the description (“message”) to at most 1024 bytes, respecting UTF-8 character boundaries. On other targets the text is unused and is stored verbatim without truncation.

Auto Trait Implementations§

§

impl<'a, 'b> Freeze for WindowsText<'a, 'b>

§

impl<'a, 'b> RefUnwindSafe for WindowsText<'a, 'b>

§

impl<'a, 'b> Send for WindowsText<'a, 'b>

§

impl<'a, 'b> Sync for WindowsText<'a, 'b>

§

impl<'a, 'b> Unpin for WindowsText<'a, 'b>

§

impl<'a, 'b> UnsafeUnpin for WindowsText<'a, 'b>

§

impl<'a, 'b> UnwindSafe for WindowsText<'a, 'b>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more