pub fn parse_policy_by_value(
binary_policy: Vec<u8>,
) -> Result<Unvalidated, Error>
Expand description
Parses binary_policy
by value; that is, copies underlying binary data out in addition to
building up parser output structures. This function returns
(unvalidated_parser_output, binary_policy)
on success, or an error if parsing failed. Note
that the second component of the success case contains precisely the same bytes as the input.
This function depends on a uniformity of interface between the “by value” and “by reference”
strategies, but also requires an unvalidated_parser_output
type that is independent of the
binary_policy
lifetime. Taken together, these requirements demand the “move-in + move-out”
interface for binary_policy
.