//! Client-to-Server IRC protocol. pub mod client; pub mod server; use std::io::Write; use nom::{ branch::alt, bytes::complete::{tag, take, take_while}, IResult, }; type ByteVec = Vec; /// Single message tag value. #[derive(Clone, Debug, PartialEq, Eq)] pub struct Tag { key: ByteVec, value: Option, } fn receiver(input: &[u8]) -> IResult<&[u8], &[u8]> { take_while(|i| i != b'\n' && i != b'\r' && i != b' ')(input) } fn token(input: &[u8]) -> IResult<&[u8], &[u8]> { take_while(|i| i != b'\n' && i != b'\r')(input) }