ingraph 0.1.0

A declaration-driven indexing framework: records and nodes are written as Rust types, and the storage rows, the dataflow between them and the GraphQL query surface are emitted from the declaration.
Documentation
//! [`Noop`] — the framework's one CROSSABLE spelling of *nothing here*, wherever an emission must
//! publish a type and the honest content is none.
//!
//! # `()` is the seam's own word, and this exists because `()` cannot cross
//!
//! [`SearchOptions`](crate::VectorEngine::SearchOptions)'s word for *no per-query knobs* is `()`,
//! and every engine reached by hand writes it. What `()` cannot do is reach a REQUEST: an emitted
//! engine variant carries `options: Option<<T as VectorEngine>::SearchOptions>`, so an engine a
//! declaration NAMES has that type published as an input — and `async_graphql` implements
//! `InputType` for no unit type, nor could this crate supply one, both the trait and `()` being
//! foreign (`E0117`).
//!
//! The obvious repair is not available either: a GraphQL input object must define at least one
//! field, so *an input object with no rows* is not a thing a schema can hold. What a schema CAN
//! hold is a SCALAR — a scalar publishes no fields — and a scalar this crate owns can carry the
//! hand-written face. So the type is a struct of this crate's own, sealed by the empty-struct
//! shape, crossing as the scalar `Noop`.
//!
//! # ONE citizen, not one per seat
//!
//! The next seat with the same shape — a published position whose honest content is none — reuses
//! this type rather than minting a sibling. That is the reason for the general name: the type says
//! *nothing here*, and WHICH nothing is the seat's own doc's to say.
//!
//! # It is a THIRD choice and not a replacement
//!
//! | an engine that … | writes | because |
//! |---|---|---|
//! | has per-query knobs | its own type, with an `InputObject` face | the knobs are reachable from a request |
//! | has none, and is NAMED by a typed word | [`Noop`] | the row is published and has to render as something |
//! | has none, and is reached by hand | `()` | nothing asks it to cross |
//!
//! The third row is the common one and stays the cheapest to write, which is the whole reason this
//! type is not the seam's default: making every engine name a framework type would tax the backends
//! that never publish anything to serve the ones that do.

/// Nothing here, as a type a schema can hold — the scalar an emission publishes where a seat is
/// mandatory and its honest content is none.
///
/// TOTAL on parse: the value carries zero information, so every value maps to the one value —
/// refusing a spelling would pretend there were something here to get wrong. Renders as `null`.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
pub struct Noop(());

impl Noop {
  /// The one value.
  #[must_use]
  pub const fn new() -> Self {
    Self(())
  }
}

#[cfg(feature = "async-graphql")]
#[async_graphql::Scalar(name = "Noop")]
impl async_graphql::ScalarType for Noop {
  fn parse(_: async_graphql::Value) -> async_graphql::InputValueResult<Self> {
    Ok(Self(()))
  }

  fn to_value(&self) -> async_graphql::Value {
    async_graphql::Value::Null
  }
}

#[cfg(test)]
mod tests;