pub struct Request {
pub id: String,
pub headers: IndexMap<String, String>,
pub payload: Payload,
}Expand description
One reverse-attach request the API has shipped to the calling
client. The proxy’s HTTP method (POST for the five JSON-RPC
methods, DELETE for session terminate) is implicit in the
super::Payload variant; the JSON-RPC {jsonrpc, id, method, params} envelope is unwrapped into the typed variant payload.
Which CLI-hosted MCP server the request targets rides as
mcp_kind on the envelope. The API parses this off the inbound
URL path (/objectiveai → super::super::McpKind::ObjectiveAi;
/{owner}/{name}/{version}/{mcp} → super::super::McpKind::Other)
before forwarding.
Wire shape (envelope is {id, mcp_kind, headers?, type, …variant fields…} after the #[serde(flatten)] on payload):
{
"id":"…",
"mcp_kind":{"type":"objective_ai"},
"headers":{"Mcp-Session-Id":"…"},
"type":"tools_list",
"cursor":"…"
}Fields§
§id: StringServer-minted correlation id. Echoed by the matching
super::super::server_response::Response.
headers: IndexMap<String, String>Verbatim copy of the headers the proxy sent on its HTTP
request to the API. The CLI conduit reads several custom
X-OBJECTIVEAI-* routing headers + Mcp-Session-Id off this
map; protocol-level headers (Host, Content-Length, …) the API
already stripped on its way in.
payload: PayloadThe typed request variant. The MCP-routed variants carry
mcp_kind inside the variant itself (see super::Payload);
non-MCP variants don’t.
Implementations§
Source§impl Request
impl Request
Sourcepub fn mcp_kind(&self) -> Option<McpKind>
pub fn mcp_kind(&self) -> Option<McpKind>
Which CLI-hosted MCP server this request targets. Some for
the MCP-routed variants (Initialize / ToolsList /
ToolsCall / ResourcesList / ResourcesRead /
SessionTerminate); None for non-MCP variants
(ReadMessageQueue / ClearMessageQueue) which hit the CLI’s
own local state. Delegates to super::Payload::mcp_kind.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Request
impl<'de> Deserialize<'de> for Request
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Request
impl JsonSchema for Request
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl UnwindSafe for Request
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more