Struct mpdpopm::messages::MessageProcessor [−][src]
pub struct MessageProcessor<'a, I1, I2> where
I1: Iterator<Item = String> + Clone,
I2: Iterator<Item = String> + Clone, { /* fields omitted */ }
Expand description
Collective state needed for processing messages, both built-in & generalized
Implementations
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)>,
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)>,
Whip up a new instance; other than cloning the iterators, should just hold references in the enclosing scope
pub async fn check_messages<'a, E>(
&self,
client: &mut Client,
idle_client: &mut IdleClient,
state: PlayerStatus,
command_chan: &str,
cmds: &mut E,
stickers: &FilterStickerNames<'a>
) -> Result<()> where
E: Extend<PinnedTaggedCmdFuture>,
pub async fn check_messages<'a, E>(
&self,
client: &mut Client,
idle_client: &mut IdleClient,
state: PlayerStatus,
command_chan: &str,
cmds: &mut E,
stickers: &FilterStickerNames<'a>
) -> Result<()> where
E: Extend<PinnedTaggedCmdFuture>,
Read messages off the commands channel & dispatch ’em
pub async fn process<'a>(
&self,
msg: String,
client: &mut Client,
state: &PlayerStatus,
stickers: &FilterStickerNames<'a>
) -> Result<Option<PinnedTaggedCmdFuture>>
pub async fn process<'a>(
&self,
msg: String,
client: &mut Client,
state: &PlayerStatus,
stickers: &FilterStickerNames<'a>
) -> Result<Option<PinnedTaggedCmdFuture>>
Process a single command