pub struct Conversation { /* private fields */ }
Expand description
Command-line implementation of ConversationHandler
This struct is unavailable if pam-client is built without the "cli"
feature.
Prompts, info and error messages will be written to STDERR, non-secret input in read from STDIN and rpassword is used to prompt the user for passwords.
§Limitations
Please note that UTF-8 encoding is assumed for terminal I/O, so this handler may fail to authenticate on legacy non-UTF-8 systems when the user input contains non-ASCII characters.
Implementations§
Source§impl Conversation
impl Conversation
Sourcepub fn info_prefix(&self) -> &str
pub fn info_prefix(&self) -> &str
The prefix text written before info text
Sourcepub fn set_info_prefix(&mut self, prefix: impl Into<String>)
pub fn set_info_prefix(&mut self, prefix: impl Into<String>)
Updates the prefix put before info text
Sourcepub fn error_prefix(&self) -> &str
pub fn error_prefix(&self) -> &str
The prefix text written before error messages
Sourcepub fn set_error_prefix(&mut self, prefix: impl Into<String>)
pub fn set_error_prefix(&mut self, prefix: impl Into<String>)
Updates the prefix put before error messages
Trait Implementations§
Source§impl Clone for Conversation
impl Clone for Conversation
Source§fn clone(&self) -> Conversation
fn clone(&self) -> Conversation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl ConversationHandler for Conversation
impl ConversationHandler for Conversation
Source§fn prompt_echo_on(&mut self, msg: &CStr) -> Result<CString, ErrorCode>
fn prompt_echo_on(&mut self, msg: &CStr) -> Result<CString, ErrorCode>
Obtains a string whilst echoing text (e.g. username) Read more
Source§fn prompt_echo_off(&mut self, msg: &CStr) -> Result<CString, ErrorCode>
fn prompt_echo_off(&mut self, msg: &CStr) -> Result<CString, ErrorCode>
Obtains a string without echoing any text (e.g. password) Read more
Source§impl Debug for Conversation
impl Debug for Conversation
Auto Trait Implementations§
impl Freeze for Conversation
impl RefUnwindSafe for Conversation
impl Send for Conversation
impl Sync for Conversation
impl Unpin for Conversation
impl UnwindSafe for Conversation
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