subsl

Crates.iosubsl
lib.rssubsl
version0.1.0
sourcesrc
created_at2021-08-06 14:29:38.323775
updated_at2021-08-06 14:29:38.323775
descriptionAdds fun new features to Rust slices
homepagehttps://github.com/connorkuehl/subsl
repositoryhttps://github.com/connorkuehl/subsl
max_upload_size
id432468
size16,465
Connor Kuehl (connorkuehl)

documentation

README

subsl

subsl extends the slices you know and love with some additional functionality.

For example, usually, you can't split a byte slice on a subslice; with subsl, you can!

Examples

use subsl::Splitter;

let http_get: &[u8] = &*b"GET / HTTP/1.0\r\n\r\nsome data in the body";
let sep = b"\r\n\r\n";
let mut iter = http_get.subsl_split(sep);
let headers = iter.next().unwrap();
let body = iter.next().unwrap();

assert_eq!(headers, b"GET / HTTP/1.0");
assert_eq!(body, b"some data in the body");

License: Apache-2.0

Commit count: 9

cargo fmt