pub struct ChainValidator<'decoder, 'source> { /* private fields */ }Expand description
A validation session tied to ONE immutable decoder source and ONE policy. A transform-cache entry alone never proves that a consumer’s policy holds. Only whole successful chains enter this session’s private verified suffixes; failures remain uncached and cycles still use the canonical visited walk. Drop the session before changing policy or moving to another decoder.
Implementations§
Source§impl<'decoder, 'source> ChainValidator<'decoder, 'source>
impl<'decoder, 'source> ChainValidator<'decoder, 'source>
pub fn new( decoder: &'decoder mut EntityDecoder<'source>, policy: ChainPolicy, ) -> Self
Sourcepub fn decoder(&mut self) -> &mut EntityDecoder<'source>
pub fn decoder(&mut self) -> &mut EntityDecoder<'source>
Access the same decoder for consumer-specific checks and output work. Replacing the decoder or its explicit configuration invalidates verified suffixes at the next validation. Lazy memo population preserves them.
Sourcepub fn validate(
&mut self,
id: u32,
) -> PlacementResult<(u32, SmallVec<[Link; 8]>)>
pub fn validate( &mut self, id: u32, ) -> PlacementResult<(u32, SmallVec<[Link; 8]>)>
Return (root, newly_verified_links), links leaf first. An already
verified starting id returns its root and no new links. At each ancestor
a known suffix stops the walk, so a parent-before-child ladder costs one
new link per product rather than 1+2+…+N links. No chain depth cap.
Auto Trait Implementations§
impl<'decoder, 'source> Freeze for ChainValidator<'decoder, 'source>
impl<'decoder, 'source> RefUnwindSafe for ChainValidator<'decoder, 'source>
impl<'decoder, 'source> Send for ChainValidator<'decoder, 'source>
impl<'decoder, 'source> Sync for ChainValidator<'decoder, 'source>
impl<'decoder, 'source> Unpin for ChainValidator<'decoder, 'source>
impl<'decoder, 'source> !UnwindSafe for ChainValidator<'decoder, 'source>
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.