pub enum WireFormat {
Json,
Toon,
ToonCompact,
}Expand description
#1579 B4 — negotiated response format for the HTTP recall/search
surfaces (?format= query param / format body field). The MCP
surface has shipped TOON since v0.6.x with a toon_compact
default (~79% smaller than JSON); this enum exposes the SAME
encoder over HTTP with a backwards-compatible json default.
Variants§
Json
application/json envelope — the HTTP default (v0.6.x
backwards compat).
Toon
Non-compact TOON (text/plain): full column set.
ToonCompact
Compact TOON (text/plain): trimmed column set, ~79% smaller
than the JSON envelope on memory rows.
Implementations§
Source§impl WireFormat
impl WireFormat
Sourcepub fn parse_http(raw: Option<&str>) -> Result<Self, String>
pub fn parse_http(raw: Option<&str>) -> Result<Self, String>
Parse the HTTP format parameter. None (param omitted)
resolves to the Self::Json default; an unrecognised value
is an Err carrying the SSOT message from
invalid_format_msg (the handlers map it to 400).
§Errors
Returns Err(message) when raw is Some of anything other
than FORMAT_JSON / FORMAT_TOON / FORMAT_TOON_COMPACT.
Trait Implementations§
Source§impl Clone for WireFormat
impl Clone for WireFormat
Source§fn clone(&self) -> WireFormat
fn clone(&self) -> WireFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WireFormat
Source§impl Debug for WireFormat
impl Debug for WireFormat
Source§impl Default for WireFormat
impl Default for WireFormat
Source§fn default() -> WireFormat
fn default() -> WireFormat
impl Eq for WireFormat
Source§impl PartialEq for WireFormat
impl PartialEq for WireFormat
Source§fn eq(&self, other: &WireFormat) -> bool
fn eq(&self, other: &WireFormat) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for WireFormat
Auto Trait Implementations§
impl Freeze for WireFormat
impl RefUnwindSafe for WireFormat
impl Send for WireFormat
impl Sync for WireFormat
impl Unpin for WireFormat
impl UnsafeUnpin for WireFormat
impl UnwindSafe for WireFormat
Blanket Implementations§
impl<T> Boilerplate for T
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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