[−][src]Trait twitchchat::messages::Extract
Extract a value from the AllCommands enum
An example:
let input = ":test!user@host PRIVMSG #museun :this is a test\r\n"; let msg: decode::Message<'_> = decode(input).next().map(|c| c.unwrap()).unwrap(); let all = AllCommands::parse(&msg).unwrap(); let all_ref = &all; // has to be a borrowed AllCommands. this doesn't move anything let pm: Option<&Privmsg<'_>> = all_ref.extract(); let pm: &Privmsg<'_> = pm.unwrap();