Skip to main content

Partial

Struct Partial 

Source
pub struct Partial;
Expand description

The partial completeness: the input is a prefix of a stream that may still grow.

Carries a runtime is_final: bool — a fact about the world, which the driver states by sealing the input when the last chunk lands (parse_partial’s is_final argument). While non-final the frontier rules hold back any construct that might be extended by later input, surfacing an Incomplete so the caller can refill and re-drive; once final it behaves exactly like Complete.

A parser cannot reach the bit: it is settable only through the owning input, which an InputRef borrows for its whole life. See Completeness.

The rules hold back only what more input could change. A terminal condition — a resource-limit trip and the poison boundary it latches — is not such a thing: it fires through the frontier rather than hiding behind them, so a streaming caller is never told to refill for a limit that can never clear. See terminal beats incomplete.

Trait Implementations§

Source§

impl Clone for Partial

Source§

fn clone(&self) -> Partial

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Completeness for Partial

Source§

const PARTIAL: bool = true

true for Partial, false for Complete. Every frontier rule is written if Cmpl::PARTIAL && …, so this constant is what erases the rules from the complete path at monomorphization.
Source§

type Finality = bool

Per-input storage for the runtime is_final flag. A zero-sized () for Complete (so carrying it costs nothing and never grows the input) and a bool for Partial.
Source§

fn initial() -> Self::Finality

The finality a freshly-constructed input starts at: open — the stream has not ended. Complete has nothing to store (a whole input is final by definition); Partial starts non-final and reaches finality only through seal.
Source§

fn is_final(finality: &Self::Finality) -> bool

Reads whether the input is final. Always true for Complete (a whole input is final by definition — every frontier rule is thereby inert); the stored flag for Partial.
Source§

fn seal(finality: &mut Self::Finality)

Seals the input: the stream has ended, and no further bytes will arrive. Read more
Source§

impl Copy for Partial

Source§

impl Debug for Partial

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Partial

Source§

impl Hash for Partial

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Partial

Source§

fn eq(&self, other: &Partial) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Partial

Source§

impl<'inp, L, Ctx, Lang: ?Sized> SurfaceIncomplete<'inp, L, Ctx, Lang> for Partial
where L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error: From<Incomplete<L::Offset>> + MaybeIncomplete,

Source§

fn surface_incomplete( offset: L::Offset, ) -> <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error

Builds the emitter’s error as an Incomplete at offset — the offset the input ran out at (the frontier). Called only in partial, non-final mode.
Source§

fn is_incomplete_error( err: &<Ctx::Emitter as Emitter<'inp, L, Lang>>::Error, ) -> bool

Whether err is the partial-input Incomplete sentinel. Read more

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.