Trait pam_client::ConversationHandler[][src]

pub trait ConversationHandler {
    fn prompt_echo_on(&mut self, prompt: &CStr) -> Result<CString, ReturnCode>;
fn prompt_echo_off(&mut self, prompt: &CStr) -> Result<CString, ReturnCode>;
fn text_info(&mut self, msg: &CStr);
fn error_msg(&mut self, msg: &CStr); fn init(&mut self, _default_user: Option<impl AsRef<str>>) { ... } }

Trait for PAM conversation functions

Implement this for custom behaviour when a PAM module asks for usernames, passwords, etc. or wants to show a message to the user

Required methods

fn prompt_echo_on(&mut self, prompt: &CStr) -> Result<CString, ReturnCode>[src]

Obtains a string whilst echoing text (e.g. username)

Errors

You should return one of the following error codes on failure.

fn prompt_echo_off(&mut self, prompt: &CStr) -> Result<CString, ReturnCode>[src]

Obtains a string without echoing any text (e.g. password)

Errors

You should return one of the following error codes on failure.

fn text_info(&mut self, msg: &CStr)[src]

Displays some text.

fn error_msg(&mut self, msg: &CStr)[src]

Displays an error message.

Loading content...

Provided methods

fn init(&mut self, _default_user: Option<impl AsRef<str>>)[src]

Called by Context directly after taking ownership of the handler.

May be called multiple times if Context::replace_conversation() is used. In this case it is called each time a context takes ownership and passed the current target username of that context (if any) as the argument.

The default implementation does nothing.

Loading content...

Implementors

impl ConversationHandler for pam_client::conv_cli::Conversation[src]

impl ConversationHandler for pam_client::conv_mock::Conversation[src]

impl ConversationHandler for pam_client::conv_null::Conversation[src]

Loading content...