Skip to main content

Road

Enum Road 

Source
pub enum Road {
    Identity,
    Join(LitStr),
    Multi,
    Declared(Conversion),
}
Expand description

THE FROM-ROAD one engine block declares: how the elected field’s value becomes THIS engine’s document text.

§from and no into, and the direction law is why

from BUILDS the projection a block is about — here, the document. There is no into leg and there is not going to be one: a document is written and searched, never hydrated back into the domain. What a hit hands back is an ADDRESS, and that pair does round-trip, which is the axis this one deliberately lacks.

§The shorthands are a SEAM, not a closed pair

join and multi are the two the framework ships because they are the two loops a converter is otherwise written out as, and they differ in the one thing the declaration is about: whether a phrase may match ACROSS two values. A third builtin arrives as a variant here and an arm in the walk — no grammar change, because the position it is written in already exists.

§Per ENGINE BLOCK, and it could not be per field

The segmentation means different things to different engines: a positional one puts a gap between segments, and a single-text-column face has to flatten them — so one converter indexes correctly in the first and subtly wrongly in the second, both “working” and only the results differing. A field-level, engine-agnostic road is therefore not expressible, which is what puts this member on the block rather than beside the election.

Variants§

§

Identity

NOTHING was declared — the IDENTITY road, the field’s value being the document text as it stands.

The default, and the one that can REFUSE: whether a value is text at all is not a question a front end can answer, so it is asked as a BOUND at the expansion and the refusal lands on the field’s own type token. See ingraph’s Searchable.

§

Join(LitStr)

join = "<sep>" — ONE segment, the values written into it with the separator between them. A phrase CAN match across two values.

§

Multi

multi — ONE SEGMENT PER VALUE. A phrase CANNOT match across two of them.

§

Declared(Conversion)

from = "…" / try_from = "…" — the conversion the declaration NAMED, in the SHIPPED family every other crossing in this grammar is written in.

Conversion::Default never reaches here: a block that named no function took Identity, which is a different road rather than a missing one.

Implementations§

Source§

impl Road

Source

pub const fn declared(&self) -> bool

Whether the block wrote a road at all, or took the identity one by saying nothing.

Source

pub const fn fallible(&self) -> bool

Whether this road can FAIL — the one bit that decides the emitted slot’s error type.

Only a declared try_from can: the identity road pushes what it was handed, and both shorthands are loops over that.

Source

pub const fn word(&self) -> &'static str

The WORD a refusal names this road by.

Trait Implementations§

Source§

impl Clone for Road

Source§

fn clone(&self) -> Self

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 Debug for Road

Source§

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

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

impl Default for Road

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Road

Source§

impl PartialEq for Road

Source§

fn eq(&self, other: &Self) -> 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 Road

Auto Trait Implementations§

§

impl !Send for Road

§

impl !Sync for Road

§

impl Freeze for Road

§

impl RefUnwindSafe for Road

§

impl Unpin for Road

§

impl UnsafeUnpin for Road

§

impl UnwindSafe for Road

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