Trait selinux_policy::Parse

source ·
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§

source

type Error: Into<Error>

The type of error that may be returned from parse(), usually ParseError or anyhow::Error.

Required Methods§

source

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 + ByteSlice + PartialEq, T: Clone + Debug + FromBytes + NoCell + PartialEq + Unaligned> Parse<ByRef<B>> for Ref<B, T>

§

type Error = Error

source§

fn parse(bytes: ByRef<B>) -> Result<(Self, ByRef<B>), Self::Error>

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>,

Parse a data structure from a prefix of a ParseStrategy.

§

type Error = Error

source§

impl<T: Clone + Debug + FromBytes + NoCell + PartialEq + Unaligned, PS: ParseStrategy<Output<T> = T>> Parse<PS> for T

§

type Error = Error