| Crates.io | ircv3_parse |
| lib.rs | ircv3_parse |
| version | 2.0.0 |
| created_at | 2024-02-29 09:22:49.935725+00 |
| updated_at | 2025-06-26 08:03:01.199638+00 |
| description | Zero-copy parser for IRCv3 messages |
| homepage | |
| repository | https://github.com/m3idnotfree/ircv3_parse.git |
| max_upload_size | |
| id | 1157586 |
| size | 108,081 |
A blazingly fast, zero-copy IRC v3 message parser
Notice: Each component parses first special character and follows the rule. If you want to use it strictly, use validation of each component.
- Tags: Start with
@, separated by;and followed by a(space)- Source: Start with
:, formatname!user@example.comorexample.comand followed by a(space)- Command: No prefix, must be letters or 3-digit number
- Middle Parameters: Start with
(space), separated by spaces- Trailing Parameters: Start with
:(space + colon), can contain any text
[dependencies]
ircv3_parse = "2.0.0"
use ircv3_parse::components::{Commands, TagValue};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let message = ircv3_parse::parse("PRIVMSG #channel :Hello everyone!")?;
assert_eq!("PRIVMSG", message.command().as_str());
assert_eq!("#channel", message.params().middles.first().unwrap());
assert_eq!("Hello everyone!", message.params().trailing.as_str());
Ok(())
}