first commit
This commit is contained in:
commit
6d3ea3e2a6
43 files changed
+8204
No files matched your search
@@ -0,0 +1,27 @@
|
||||
//! Meow protocol v2 wire types.
|
||||
//!
|
||||
//! Generated from `rust/proto/meow.proto`. This crate contains no logic besides
|
||||
//! small encoding helpers; protocol semantics live in `meow-core`.
|
||||
|
||||
#![forbid(unsafe_code)]
|
||||
#![cfg_attr(not(test), warn(clippy::unwrap_used, clippy::expect_used))]
|
||||
|
||||
#[allow(clippy::all, missing_docs)]
|
||||
pub mod v2 {
|
||||
include!(concat!(env!("OUT_DIR"), "/meow.v2.rs"));
|
||||
}
|
||||
|
||||
pub use prost::Message;
|
||||
|
||||
/// Current protocol version carried in every top-level wire object.
|
||||
pub const PROTOCOL_VERSION: u32 = 2;
|
||||
|
||||
/// Decode helper returning a uniform error type.
|
||||
pub fn decode<M: Message + Default>(bytes: &[u8]) -> Result<M, prost::DecodeError> {
|
||||
M::decode(bytes)
|
||||
}
|
||||
|
||||
/// Encode helper.
|
||||
pub fn encode<M: Message>(msg: &M) -> Vec<u8> {
|
||||
msg.encode_to_vec()
|
||||
}
|
||||
Reference in new issue
Block a user