Skip to main content

WebStack

Enum WebStack 

Source
pub enum WebStack {
    Spine,
    OpenAiApi,
    AnthropicApi,
    Mcp,
    Grpc,
    HttpJson,
    GraphQl,
}
Expand description

Web stacks / wire protocols with curated agentic profiles.

Variants§

§

Spine

SPINE (nervosys/SPINE) — the agentic-first web stack. Native StreamStart/Token/End frames with text / bytes / encoded-latent / tool-call data variants; CapabilityQuery/CapabilityAdvertisement with JSON Schema and optional semantic embeddings; TraceContext (W3C traceparent) attached inline; OpenAI-compatible SSE bridge in the gateway; bearer auth secure by default as of v1.3.0; optional FIPS 140-3 build via aws-lc-rs.

§

OpenAiApi

OpenAI API — HTTP + JSON with SSE chat.completion.chunk streaming; tools parameter for function calling; bearer auth + TLS.

§

AnthropicApi

Anthropic API — HTTP + JSON with SSE message_start/delta/stop streaming; tools parameter for tool use; bearer auth + TLS.

§

Mcp

Model Context Protocol — JSON-RPC over stdio or SSE; tools/list, resources/list, prompts/list introspection RPCs are the surface.

§

Grpc

gRPC — protobuf over HTTP/2 with first-class server / client / bidi streaming, service reflection, mTLS, interceptors for auth/tracing.

§

HttpJson

Plain HTTP + JSON (REST-shaped). The generic baseline an agent has to fall back to when nothing more specific exists.

§

GraphQl

GraphQL — query language with introspection built into the protocol; subscriptions for streaming.

Implementations§

Source§

impl WebStack

Source

pub fn all() -> [WebStack; 7]

All profiled web stacks, in fixed (deterministic) order.

Source

pub fn name(self) -> &'static str

Canonical lowercase name.

Examples found in repository?
examples/web_benchmark.rs (line 25)
13fn main() {
14    println!("agentic-eval — web stacks / wire protocols for agentic AI use");
15    println!("axes: streaming, tool-discoverability, encoding, interop, security\n");
16
17    // ── Ranked benchmark (best-first by composite agentic fitness) ───────────
18    println!(
19        "{:<15} {:>7}   {:>9} {:>5} {:>8} {:>7} {:>8}",
20        "stack", "fitness", "streaming", "tools", "encoding", "interop", "security"
21    );
22    for p in rank_web_stacks() {
23        println!(
24            "{:<15} {:>7.2}   {:>9.2} {:>5.2} {:>8.2} {:>7.2} {:>8.2}",
25            p.stack.name(),
26            p.fitness(),
27            p.streaming,
28            p.tool_discoverability,
29            p.encoding_efficiency,
30            p.interop,
31            p.security_primitives,
32        );
33    }
34
35    // ── Head-to-head: SPINE vs the OpenAI API (the dominant baseline) ───────
36    println!("\nhead-to-head (positive = SPINE fits agentic use better):");
37    print!("{}", compare_web_stacks(WebStack::Spine, WebStack::OpenAiApi));
38
39    // ── Evidence behind SPINE's profile ─────────────────────────────────────
40    println!("\nwhy SPINE scores where it does:");
41    for e in &profile(WebStack::Spine).evidence {
42        println!("  - {e}");
43    }
44
45    println!(
46        "\nReading: SPINE now leads the composite (0.90), edging gRPC (0.83).\n\
47         It was always strong on the agent-native axes it was designed for\n\
48         (LLM StreamStart/Token/End frames with multiplex-aware StreamCancel +\n\
49         mid-stream usage, a CapabilityQuery handshake, inline W3C TraceContext).\n\
50         v1.4.0's CBOR wire format plus v1.5.0's byte-string tensor payloads\n\
51         bring encoding to parity with protobuf (0.95; 89% smaller embedding\n\
52         frames), and per-message Ed25519 signed frames give message-level\n\
53         non-repudiation beyond channel mTLS (security 0.95). The inflection is\n\
54         three deployable bridges: a runnable MCP stdio server (v1.6.0), the\n\
55         OpenAI-compatible gateway, and a production-grade gRPC AgentService\n\
56         (v1.8.0, reflection-enabled + real-model-backed in v1.9.0) — reachable\n\
57         from the three dominant agent ecosystems with standard client stubs,\n\
58         lifting interop 0.15 -> 0.67. Honest\n\
59         caveat: interop is still SPINE's weakest axis — the bridges map the\n\
60         agentic surface (not SPINE's native binary frames) and SPINE's own\n\
61         protocol has ~zero native install base."
62    );
63}
Source

pub fn from_name(name: &str) -> Option<WebStack>

Parse a (case-insensitive) name; accepts common aliases (openai, claude, model-context-protocol, rest, graphql-spec, …).

Trait Implementations§

Source§

impl Clone for WebStack

Source§

fn clone(&self) -> WebStack

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 Copy for WebStack

Source§

impl Debug for WebStack

Source§

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

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

impl Eq for WebStack

Source§

impl Hash for WebStack

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 WebStack

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for WebStack

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for WebStack

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.