Skip to main content

SearchModel

Struct SearchModel 

Source
pub struct SearchModel {
    pub krate: Path,
    pub name: Ident,
    pub vis: Visibility,
    pub seats: Vec<SeatModel>,
    pub dedup: Dedup,
    pub limit: Option<NonZeroU32>,
    pub graphql: Option<GraphqlKind>,
    pub members: Vec<MemberModel>,
}
Expand description

A validated search recipe, ready to emit.

PLAIN — no Copy, no comparison — for super::tower::TowerModel’s reason: a model is carried once, from the pass that validated it to the pass that emits it.

Fields§

§krate: Path

The path to the ingraph crate itself — ::ingraph unless #[ingraph(crate = "…")] named another.

§name: Ident

The declared type — what the recipe’s own faces are minted on.

§vis: Visibility

The declaration’s own visibility, which everything minted beside it takes.

§seats: Vec<SeatModel>

THE BROADCAST SEATS — shared(text(type = "String"), …), in declaration order.

EMPTY where the head wrote no shared(…) at all, which is the recipe whose arms are each asked their own question. A seat is what a caller fills once for the whole recipe, and the arms that read it say so with their own shared word.

SEVERAL are a CHOICE and never a companion: the published field asks with one @oneOf object and a client fills exactly one seat, so a value that rides WITH a question — a language tag, a locale — is a field of a seat’s own TYPE rather than a seat beside it. Written as a seat it would be unaskable beside the question it belongs to. The grammar’s own note carries the boundary in full; see ingraph-derive’s search module.

§dedup: Dedup

How this recipe’s fused doors tell two roots apart — dedup(hash).

NOT an Option, and that is the graph root’s own shape one grain down: the absent word is Dedup::Hash rather than a deferral, because every key an emitted node mints derives Hash and the join a recipe has always had is the one an unwritten word still names.

§limit: Option<NonZeroU32>

How many roots the recipe’s own door answers with when nothing asks otherwise — limit = 20.

None where the word was OMITTED, and it is a deferral rather than a default: the tier order is request > recipe > election field > container > the framework’s own number, so a recipe that names none lets the declaration below it answer. Writing the framework’s 20 in here would make an unwritten word outrank an election that wrote its own.

§graphql: Option<GraphqlKind>

WHICH BACKEND DRESSES THIS RECIPE — graphql(async_graphql), or None where it named none.

The retrieving family’s presence law at the recipe grain: a recipe with no block emits its whole Rust surface — the record, the packages, the evidence enums and the door — and mints no schema. That is what a fused read a deployment drives from Rust wants, and it is also what keeps the wire face’s own demands off a recipe that publishes nothing: the seams a resolver reaches its members through (FusedEngine, FusedCitizen, WireRoot) are asked for only where a field is published.

§members: Vec<MemberModel>

The members, in declaration order. NEVER EMPTY: a recipe with no member is refused at the front end, there being nothing to ask and nothing to fuse.

Implementations§

Source§

impl SearchModel

Source

pub fn fuse(&self) -> TokenStream

The RECIPE FUSION emission, whole: the tower packages, the two request packages, the evidence and refusal enums, and the door.

UNCONDITIONAL, which is the word-count law’s absence stated as code: a recipe with one member is a recipe that fuses one ranking, and a one-term fold is the fold. What made the root’s emission conditional was that a root’s members arrived by a word rather than by a list, so fewer than two was a state it could be in; a recipe with no member is refused at the front end.

Source§

impl SearchModel

Source

pub fn record(&self) -> TokenStream

The DeclaredSearch impl, whole.

Source§

impl SearchModel

Source

pub fn emit(&self) -> TokenStream

EVERYTHING a recipe mints: the record it states across the expansion wall, and the fusion unit its door runs.

The recipe REPLACES its own declaration, as every attribute macro does, so the host struct is echoed by the front end and what arrives here is only what is added beside it.

Source

pub fn mounts(&self) -> bool

WHETHER THIS RECIPE PUBLISHES A QUERY FIELD AT ALL.

Two conditions, and neither counts past zero. A recipe has to have NAMED a backend — the presence law — and it has to broadcast into AT LEAST ONE seat, because the wire road’s question is the seat a client fills and a recipe with none has nothing for that argument to be.

SEVERAL seats used to fail here too, and the @oneOf member seats are what retired that arm: the published field’s question becomes a choice — one input field per seat, exactly one filled — and the members whose arms bought that seat answer the request. A recipe with ONE seat publishes the bare argument it always did, which is the additive law read at the schema.

Source

pub fn chooses(&self) -> bool

WHETHER THE PUBLISHED QUESTION IS A CHOICE — several declared seats, so the field asks with one @oneOf argument rather than with the seat itself.

The fork every wire-side emitter reads, written once: a single-seat recipe’s whole face is what it was before the choice existed, byte for byte, and this is the one predicate that says so.

Source

pub fn bound(&self) -> bool

Whether any member binds any tower at all.

The question the question layer asks first: a recipe whose members are all plain coordinate members has no arm to publish and no tower to walk, and is the one-member text search the retiring ask family used to spell.

Trait Implementations§

Source§

impl Clone for SearchModel

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 SearchModel

Source§

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

Formats the value using the given formatter. 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<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.