[−][src]Trait twitchchat::Parse
A trait for parsing messages
Example
let input = ":test!test@test JOIN #museun\r\n"; // decode and decode_one will parse a `Message` from a string let message: decode::Message<'_> = decode::decode(&input).next().unwrap().unwrap(); // which can be used to parse into a specific message let join: Join<'_> = Join::parse(&message).unwrap(); assert_eq!(join, Join { channel: Cow::Borrowed("#museun"), name: Cow::Borrowed("test") });
Required methods
fn parse(input: T) -> Result<Self, InvalidMessage>
Tries to parse the input as this message