pub trait Parse<PS: ParseStrategy>: Sized {
type Error: Into<Error>;
// Required method
fn parse(bytes: PS) -> Result<(Self, PS), Self::Error>;
}
Expand description
A data structure that can be parsed as a part of a binary policy.
Required Associated Types§
sourcetype Error: Into<Error>
type Error: Into<Error>
The type of error that may be returned from parse()
, usually ParseError
or
anyhow::Error
.
Required Methods§
sourcefn parse(bytes: PS) -> Result<(Self, PS), Self::Error>
fn parse(bytes: PS) -> Result<(Self, PS), Self::Error>
Parses a Self
from bytes
, returning the Self
and trailing bytes, or an error if
bytes corresponding to a Self
are malformed.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<B: Debug + SplitByteSlice + PartialEq, T: Clone + Debug + FromBytes + KnownLayout + Immutable + PartialEq + Unaligned> Parse<ByRef<B>> for Ref<B, T>
impl<B: Debug + SplitByteSlice + PartialEq, T: Clone + Debug + FromBytes + KnownLayout + Immutable + PartialEq + Unaligned> Parse<ByRef<B>> for Ref<B, T>
Implementors§
source§impl<PS: ParseStrategy> Parse<PS> for ParsedPolicy<PS>where
Signature<PS>: Parse<PS>,
ExtensibleBitmap<PS>: Parse<PS>,
SymbolList<PS, CommonSymbol<PS>>: Parse<PS>,
SymbolList<PS, Class<PS>>: Parse<PS>,
SymbolList<PS, Role<PS>>: Parse<PS>,
SymbolList<PS, Type<PS>>: Parse<PS>,
SymbolList<PS, User<PS>>: Parse<PS>,
SymbolList<PS, ConditionalBoolean<PS>>: Parse<PS>,
SymbolList<PS, Sensitivity<PS>>: Parse<PS>,
SymbolList<PS, Category<PS>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<AccessVector<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<ConditionalNode<PS>>>: Parse<PS>,
RoleTransitions<PS>: Parse<PS>,
RoleAllows<PS>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<FilenameTransition<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<DeprecatedFilenameTransition<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<InitialSid<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<NamedContextPair<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<Port<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<Node<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<FsUse<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<IPv6Node<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<InfinitiBandPartitionKey<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<InfinitiBandEndPort<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<GenericFsContext<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<RangeTransition<PS>>>: Parse<PS>,
impl<PS: ParseStrategy> Parse<PS> for ParsedPolicy<PS>where
Signature<PS>: Parse<PS>,
ExtensibleBitmap<PS>: Parse<PS>,
SymbolList<PS, CommonSymbol<PS>>: Parse<PS>,
SymbolList<PS, Class<PS>>: Parse<PS>,
SymbolList<PS, Role<PS>>: Parse<PS>,
SymbolList<PS, Type<PS>>: Parse<PS>,
SymbolList<PS, User<PS>>: Parse<PS>,
SymbolList<PS, ConditionalBoolean<PS>>: Parse<PS>,
SymbolList<PS, Sensitivity<PS>>: Parse<PS>,
SymbolList<PS, Category<PS>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<AccessVector<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<ConditionalNode<PS>>>: Parse<PS>,
RoleTransitions<PS>: Parse<PS>,
RoleAllows<PS>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<FilenameTransition<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<DeprecatedFilenameTransition<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<InitialSid<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<NamedContextPair<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<Port<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<Node<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<FsUse<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<IPv6Node<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<InfinitiBandPartitionKey<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<InfinitiBandEndPort<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<GenericFsContext<PS>>>: Parse<PS>,
Array<PS, PS::Output<U32>, Vec<RangeTransition<PS>>>: Parse<PS>,
Parse a data structure from a prefix of a ParseStrategy
.