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>
impl<'a, 'b> WindowsText<'a, 'b>
Sourcepub const fn new(title: &'a str, description: &'b str) -> Option<Self>
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};Sourcepub fn new_truncated(title: &'a str, description: &'b str) -> Self
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> 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
Mutably borrows from an owned value. Read more