Skip to main content

Demux

Struct Demux 

Source
pub struct Demux<CA: ConversationAdapter>(/* private fields */);
Expand description

A Conversation which asks the questions one at a time.

This is automatically created by ConversationAdapter::into_conversation.

Trait Implementationsยง

Sourceยง

impl<CA: ConversationAdapter> Conversation for Demux<CA>

Sourceยง

fn communicate(&self, messages: &[Exchange<'_>])

Sends messages to the user. Read more
Sourceยง

impl<CA: ConversationAdapter> From<CA> for Demux<CA>

Sourceยง

fn from(value: CA) -> Self

Converts to this type from the input type.

Auto Trait Implementationsยง

ยง

impl<CA> Freeze for Demux<CA>
where CA: Freeze,

ยง

impl<CA> RefUnwindSafe for Demux<CA>
where CA: RefUnwindSafe,

ยง

impl<CA> Send for Demux<CA>
where CA: Send,

ยง

impl<CA> Sync for Demux<CA>
where CA: Sync,

ยง

impl<CA> Unpin for Demux<CA>
where CA: Unpin,

ยง

impl<CA> UnsafeUnpin for Demux<CA>
where CA: UnsafeUnpin,

ยง

impl<CA> UnwindSafe for Demux<CA>
where CA: UnwindSafe,

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<C> ConversationAdapter for C
where C: Conversation + ?Sized,

Sourceยง

fn prompt(&self, message: impl AsRef<OsStr>) -> Result<OsString, ErrorCode>

Prompts the user for something.
Sourceยง

fn masked_prompt( &self, message: impl AsRef<OsStr>, ) -> Result<OsString, ErrorCode>

Prompts the user for something, but hides what the user types.
Sourceยง

fn error_msg(&self, message: impl AsRef<OsStr>)

Alerts the user to an error.
Sourceยง

fn info_msg(&self, message: impl AsRef<OsStr>)

Sends an informational message to the user.
Sourceยง

fn radio_prompt( &self, message: impl AsRef<OsStr>, ) -> Result<OsString, ErrorCode>

[Linux extension] Prompts the user for a yes/no/maybe conditional. Read more
Sourceยง

fn binary_prompt(&self, _: (&[u8], u8)) -> Result<BinaryData, ErrorCode>

[Linux extension] Requests binary data from the user. Read more
Sourceยง

fn into_conversation(self) -> Demux<Self>
where Self: Sized,

Lets you use this simple conversation as a full Conversation. 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.