Skip to main content

parts

Function parts 

Source
pub fn parts(path: &str) -> Parts<'_> ⓘ
Expand description

The segments of path, split only at a / no escape covers and still escaped as written.

The empty path has none. Anything else yields one more segment than it has separators, empty ones included, so a caller that requires non-empty segments checks them itself.

let parts: Vec<_> = moq_net::path::parts(r"room/a\/b/cam").collect();
assert_eq!(parts, ["room", r"a\/b", "cam"]);
assert_eq!(moq_net::path::parts("").count(), 0);