mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2026-03-12 20:00:31 +00:00
remove codec and framing
This commit is contained in:
parent
2e35358260
commit
c2f4472886
@ -1,15 +0,0 @@
|
||||
//! Protocol codec
|
||||
|
||||
use std::io;
|
||||
|
||||
use serde::de::DeserializeOwned;
|
||||
|
||||
use crate::transport::framing::Framing;
|
||||
|
||||
pub mod json;
|
||||
pub mod postcard;
|
||||
|
||||
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>;
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
//! Protocol framing
|
||||
|
||||
use std::io::{self, BufRead, Write};
|
||||
|
||||
pub trait Framing {
|
||||
type Buf: Default + Send + Sync;
|
||||
|
||||
fn read<'a, R: BufRead + ?Sized>(
|
||||
inp: &mut R,
|
||||
buf: &'a mut Self::Buf,
|
||||
) -> io::Result<Option<&'a mut Self::Buf>>;
|
||||
|
||||
fn write<W: Write + ?Sized>(out: &mut W, buf: &Self::Buf) -> io::Result<()>;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user