mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2026-02-19 18:49:16 +00:00
13 lines
271 B
Rust
13 lines
271 B
Rust
//! Protocol codec
|
|
|
|
use std::io;
|
|
|
|
use serde::de::DeserializeOwned;
|
|
|
|
use crate::framing::Framing;
|
|
|
|
pub trait Codec: Framing {
|
|
fn encode<T: serde::Serialize>(msg: &T) -> io::Result<Self::Buf>;
|
|
fn decode<T: DeserializeOwned>(buf: &mut Self::Buf) -> io::Result<T>;
|
|
}
|