ircv3_parse 4.0.0

Zero-copy parser for IRCv3 messages
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![allow(unused)]
#[allow(unused_imports)]
use ircv3_parse::de::FromMessage as _;
use ircv3_parse::{FromMessage, ToMessage};

#[test]
fn kebab_case() {
    #[derive(Debug, PartialEq, FromMessage, ToMessage)]
    #[irc(tag = "batch-type")]
    struct BatchStart;

    let input = "@batch-type=batch-start PRIVMSG #channel :hello";
    let msg: BatchStart = ircv3_parse::from_str(input).unwrap();
    assert_eq!(BatchStart, msg);

    let output = ircv3_parse::to_message(&msg).unwrap();
    assert_eq!("@batch-type=batch-start ", output);
}