selinux::policy

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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>

Source§

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.

Source§

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