-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: move serialization into zenoh-ext (#1473)
* feat!: move serialization into zenoh-ext * refactor: rename write_xxx/read_xxx to (de)serialize_xxx * fix: lints * fix: fix `ZBytes::as_shm` * fix: make protoc non-mandatory to execute z_bytes example * fix: lint * fix: lint * fix: lint * fix: add Serialize implementation for ZBytes * fix: lints * refactor: replace extension traits by dedicated types * fix: lints * fix: add `?Sized` bound to `z_serialize` * fix: add VarInt implementation * feat!: ZBytesWriter/ZSerializer have no more lifetime * feat: use bytemuck for `VarInt` slice conversion * feat: remove bytemuck depedency * fix: remove litigious `From` implementation * fix: fix tests * fix: fix tests * docs: add varint example * fix: typo * fix: fix serialization test * fix: outdated doc * feat: add `ZDeserializer::deserialize_n` * fix: typo * fix: remove useless dependency * fix: fix test * serialization for zenoh types Encoding and Timestamp * fix: test * feat: implement serialization for array as variable-size collection * docs: add array example in z_bytes * code formatting --------- Co-authored-by: Michael Ilyin <[email protected]>
- Loading branch information
Showing
50 changed files
with
1,340 additions
and
3,875 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use std::{env, fs::File, io::Write, path::Path}; | ||
|
||
use which::which; | ||
|
||
fn main() -> std::io::Result<()> { | ||
// If protoc is not installed, we cheat because building protoc from source | ||
// with protobuf-src is way too long | ||
if which("protoc").is_err() { | ||
const PROTO: &str = r#"#[derive(Clone, PartialEq, ::prost::Message)] pub struct Entity { #[prost(uint32, tag = "1")] pub id: u32, #[prost(string, tag = "2")] pub name: ::prost::alloc::string::String,}"#; | ||
let out_path = Path::new(&env::var("OUT_DIR").unwrap()).join("example.rs"); | ||
File::create(out_path)?.write_all(PROTO.as_bytes())?; | ||
return Ok(()); | ||
} | ||
prost_build::compile_protos(&["examples/example.proto"], &["examples/"])?; | ||
Ok(()) | ||
} |
Oops, something went wrong.