watermelon-proto 0.1.8

#[no_std] NATS Core Sans-IO protocol implementation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
#[derive(Debug)]
pub(crate) struct CrlfFinder(memchr::memmem::Finder<'static>);

impl CrlfFinder {
    pub(crate) fn new() -> Self {
        Self(memchr::memmem::Finder::new(b"\r\n"))
    }

    pub(crate) fn find(&self, haystack: &[u8]) -> Option<usize> {
        self.0.find(haystack)
    }
}