INNER CODE UNIT · Rust

from

nativeshell/nativeshell · nativeshell/src/codec/mod.rs:58

    fn from(e: Error) -> Self {
        Self {
            code: format!("{e:?}"),
            message: Some(format!("{e}")),
            details: Default::default(),
        }
    }
}

pub trait MessageCodec<V>: Send + Sync {
    /// Methods for plain messages
    fn encode_message(&self, v: &V) -> Vec<u8>;
    fn decode_message(&self, buf: &[u8]) -> Option<V>;
}

pub trait MethodCodec<V>: Send + Sync {
    fn decode_method_call(&self, buf: &[u8]) -> Option<MethodCall<V>>;
    fn encode_success_envelope(&self, v: &V) -> Vec<u8>;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…