prost-uuid-doubleint

Crates.ioprost-uuid-doubleint
lib.rsprost-uuid-doubleint
version0.1.1
sourcesrc
created_at2024-07-17 12:32:10.398877
updated_at2024-07-17 13:21:23.186636
descriptionProst uuid custom datatype
homepage
repositoryhttps://github.com/evilbluebeaver/prost_uuid_doubleint
max_upload_size
id1306157
size4,499
Kirill Kindiuk (evilbluebeaver)

documentation

README

prost-uuid-doubleint

Custom uuid type for using in protobuf .proto files.

Represents uuid as 2 u64 integers.

Rust Crates.io

Usage

Proto files

You need to have a file with Uuid

syntax = "proto3";
package uuid;

message Uuid {
   uint64 high = 1;
   uint64 low = 2;
}

and import it from another .proto file

syntax = "proto3";
package user;

import "uuid.proto";

message User {
    uuid.Uuid id = 1;
    string name = 2;
}

Cargo.toml

...
[dependencies]
prost = "0.13"
prost-uuid-doubleint = "0.1.0"
...

Build.rs

...
    prost_build::Config::new()
        .extern_path(".uuid.Uuid", "::prost_uuid_doubleint::ProstUuid")
        .compile_protos(&["./proto/user.proto"], &["./proto"])
...

Tnanks to

https://gitlab.com/oss47/prost-uuid

Commit count: 0

cargo fmt