Skip to main content

Rdf12LiteralValidator

Struct Rdf12LiteralValidator 

Source
pub struct Rdf12LiteralValidator { /* private fields */ }
Expand description

Bounded lexical inspection under the three mandatory RDF 1.2 datatypes.

Uses shared structural metadata checks and rdf-reasoning lexical semantics. Unknown encountered datatypes remain opaque. This does not implement datatype value comparison or graph-wide consistency and never rewrites a source term.

Implementations§

Source§

impl Rdf12LiteralValidator

Source

pub const fn new(maximum: u64) -> Self

Set a strict byte budget, including opaque datatype payloads. A zero budget permits only an empty lexical form, verified through an EOF probe.

Source

pub async fn validate<R: LiteralReader>( &self, reader: &mut R, ) -> Result<LiteralReport, LiteralError<R::Error>>

Validate metadata, then stream the lexical form using 4099 bytes of scratch.

No whole literal is retained. At most three incomplete UTF-8 bytes carry between reads. An exact byte budget permits the final EOF probe; exceeding it fails. Callers separately budget total attempt work across literals.

§Errors

Invalid standard metadata, invalid UTF-8, a recognized lexical violation, cancellation, resource exhaustion or a backend error abort inspection. A lexical violation is semantic evidence about this literal; it does not certify graph inconsistency or authorize publishing a partial inference.

Source

pub async fn inspect<R: LiteralReader>( &self, reader: &mut R, ) -> Result<LiteralInspection, LiteralError<R::Error>>

Inspect the entire payload, retaining only its first shared lexical violation.

A semantic diagnostic is returned only after successful UTF-8 inspection through EOF. Later transport/cancellation/resource errors invalidate it. Scratch stays fixed at 4099 bytes plus one violation, even for huge values.

§Errors

Invalid metadata/UTF-8, storage, cancellation or byte/reader limits abort.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V