[][src]Function hrx::parse::discover_first_boundary_length

pub fn discover_first_boundary_length<S: AsRef<str>>(
    in_data: S
) -> Option<NonZeroUsize>

Search the specified for the length of the first boundary.

Returns None if no valid boundary exists.

Examples

assert_eq!(discover_first_boundary_length("<=====>"), NonZeroUsize::new(5));
assert_eq!(discover_first_boundary_length("henlo\n<===> menlo"), NonZeroUsize::new(3));

assert_eq!(discover_first_boundary_length("<>"), None);
assert_eq!(discover_first_boundary_length("коммунизм"), None);