use std::error::Error;
use wireframe::{
app::{Envelope, WireframeApp},
codec::LengthDelimitedFrameCodec,
message::{DecodeWith, EncodeWith},
serializer::{BincodeSerializer, Serializer},
};
struct NoDefaultSerializer;
impl Serializer for NoDefaultSerializer {
fn serialize<M>(&self, _value: &M) -> Result<Vec<u8>, Box<dyn Error + Send + Sync>>
where
M: EncodeWith<Self>,
{
todo!("this fixture never serializes a message")
}
fn deserialize<M>(&self, _bytes: &[u8]) -> Result<(M, usize), Box<dyn Error + Send + Sync>>
where
M: DecodeWith<Self>,
{
todo!("this fixture never deserializes a message")
}
}
fn main() {
let _app: WireframeApp<NoDefaultSerializer, (), Envelope, LengthDelimitedFrameCodec> =
WireframeApp::<BincodeSerializer, (), Envelope>::default()
.serializer(NoDefaultSerializer)
.with_codec(LengthDelimitedFrameCodec::new(4096));
}