pub struct JsonCodec {
pub pretty: bool,
}Expand description
JSON codec using serde_json
This is the default codec for MCP protocol compliance. It produces human-readable JSON suitable for debugging and logging.
Fields§
§pretty: boolPretty print output (default: false)
Implementations§
Trait Implementations§
Source§impl Codec for JsonCodec
impl Codec for JsonCodec
Source§fn decode<T: DeserializeOwned>(&self, bytes: &[u8]) -> CodecResult<T>
fn decode<T: DeserializeOwned>(&self, bytes: &[u8]) -> CodecResult<T>
Decode bytes to a value
Source§fn content_type(&self) -> &'static str
fn content_type(&self) -> &'static str
Get the content type for this codec (e.g., “application/json”)
Source§fn supports_streaming(&self) -> bool
fn supports_streaming(&self) -> bool
Check if this codec supports streaming
Auto Trait Implementations§
impl Freeze for JsonCodec
impl RefUnwindSafe for JsonCodec
impl Send for JsonCodec
impl Sync for JsonCodec
impl Unpin for JsonCodec
impl UnsafeUnpin for JsonCodec
impl UnwindSafe for JsonCodec
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
Mutably borrows from an owned value. Read more