Parse a slice of `bytes` into a set of prefixes, returning both the configured [`Prefixes`] as well as any remaining bytes.
(mut bytes: &[u8])
| 517 | /// Parse a slice of `bytes` into a set of prefixes, returning both the |
| 518 | /// configured [`Prefixes`] as well as any remaining bytes. |
| 519 | fn parse(mut bytes: &[u8]) -> (Self, &[u8]) { |
| 520 | let mut prefixes = Self::default(); |
| 521 | while !bytes.is_empty() && prefixes.try_assign(bytes[0]).is_ok() { |
| 522 | bytes = &bytes[1..]; |
| 523 | } |
| 524 | (prefixes, bytes) |
| 525 | } |
| 526 | |
| 527 | /// Attempt to parse a `byte` as a prefix and, if successful, assigns it to |
| 528 | /// the correct prefix group. |