[][src]Struct mpdpopm::messages::MessageProcessor

pub struct MessageProcessor<'a, I1, I2> where
    I1: Iterator<Item = String> + Clone,
    I2: Iterator<Item = String> + Clone
{ /* fields omitted */ }

Collective state needed for processing messages, both built-in & generalized

Implementations

impl<I1, I2, '_> MessageProcessor<'_, I1, I2> where
    I1: Iterator<Item = String> + Clone,
    I2: Iterator<Item = String> + Clone
[src]

pub fn new<'a, IGC>(
    music_dir: &'a str,
    rating_sticker: &'a str,
    ratings_cmd: &'a str,
    ratings_cmd_args: I1,
    playcount_sticker: &'a str,
    playcount_cmd: &'a str,
    playcount_cmd_args: I2,
    lastplayed_sticker: &'a str,
    gen_cmds: IGC
) -> MessageProcessor<'a, I1, I2> where
    IGC: Iterator<Item = (String, GeneralizedCommand)>, 
[src]

Whip up a new instance; other than cloning the iterators, should just hold references in the enclosing scope

pub async fn check_messages<E, '_, '_, '_, '_, '_>(
    &'_ self,
    client: &'_ mut Client,
    idle_client: &'_ mut IdleClient,
    state: PlayerStatus,
    command_chan: &'_ str,
    cmds: &'_ mut E
) -> Result<()> where
    E: Extend<PinnedTaggedCmdFuture>, 
[src]

Read messages off the commands channel & dispatch 'em

pub async fn process<'_, '_, '_>(
    &'_ self,
    msg: String,
    client: &'_ mut Client,
    state: &'_ PlayerStatus
) -> Result<Option<PinnedTaggedCmdFuture>>
[src]

Process a single command

Auto Trait Implementations

impl<'a, I1, I2> RefUnwindSafe for MessageProcessor<'a, I1, I2> where
    I1: RefUnwindSafe,
    I2: RefUnwindSafe
[src]

impl<'a, I1, I2> Send for MessageProcessor<'a, I1, I2> where
    I1: Send,
    I2: Send
[src]

impl<'a, I1, I2> Sync for MessageProcessor<'a, I1, I2> where
    I1: Sync,
    I2: Sync
[src]

impl<'a, I1, I2> Unpin for MessageProcessor<'a, I1, I2> where
    I1: Unpin,
    I2: Unpin
[src]

impl<'a, I1, I2> UnwindSafe for MessageProcessor<'a, I1, I2> where
    I1: UnwindSafe,
    I2: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> UnsafeAny for T where
    T: Any