Marcel Hlopko
8e210a888d
Derive Debug for ProxyVTable
...
This is now possible since we use the latest Rust toolchain.
PiperOrigin-RevId: 549038928
1 year ago
Hong Shin
7e9d0c1630
Add V0 support for fixed ints (32 and 64)
...
PiperOrigin-RevId: 548716260
1 year ago
Nevena Kotlaja
19d674dca6
Clean grep_includes
...
PiperOrigin-RevId: 548156626
1 year ago
Protobuf Team Bot
8fe9d8e7c1
Define the shape of ProtoStr as a DST
...
PiperOrigin-RevId: 547871451
1 year ago
Protobuf Team Bot
230a9a751f
Remove stubs for in-place mutating BytesMut operations
...
These are invalid for UPB which uses immutable string views.
This also adjusts some docs:
- removes a promise in the language of `truncate`
that no reallocation will occur.
- removes language about DerefMut and replaces the `&mut Vec<u8>` analogy
PiperOrigin-RevId: 547603918
1 year ago
Hong Shin
43778a5e2b
Add V0 support for floats and doubles
...
PiperOrigin-RevId: 547503785
1 year ago
Adrian Sadłocha
d70e3dea0e
Update a doc comment
...
PiperOrigin-RevId: 547464862
1 year ago
Protobuf Team Bot
a75def66cd
Define the shape of BytesMut with stubbed methods
...
This is the primary mutator for `bytes` fields, which proxy `[u8]`.
PiperOrigin-RevId: 547242972
1 year ago
Hong Shin
fcab1a4371
Add V0 support for signed ints
...
PiperOrigin-RevId: 547200059
1 year ago
Protobuf Team Bot
d42b23718a
Add remaining helper functions for Optional v0.6
...
None of these methods are necessary for users to use Optional, but they
are particularly useful and mirror the methods inside of
std::collections::hash_map::Entry.
PiperOrigin-RevId: 547038832
1 year ago
Protobuf Team Bot
0d7a39663b
Implement the rest of the v0.6 Optional design
...
This introduces a new OptionalProxied trait in order to support the needed trait methods.
PiperOrigin-RevId: 546938819
1 year ago
Hong Shin
b01794cb3b
Add test that ensures rust protos build with reserved keywords
...
Also confirmed that this fails to build without the `r#` inside singular_scalar.cc
PiperOrigin-RevId: 546906226
1 year ago
Hong Shin
4f20efbb78
Internal Change
...
PiperOrigin-RevId: 546867607
1 year ago
Hong Shin
b3942c0618
In this CL, we add V0 support for unsigned ints (32 and 64).
...
PiperOrigin-RevId: 546859828
1 year ago
Dmitri Gribenko
3508b47f34
Improve doc comments
...
No need to say "represents" when describing a type (all types represent
something in real world, they are not the real thing), and "ABI-compatible"
needs a dash.
PiperOrigin-RevId: 546813197
1 year ago
Protobuf Team Bot
9609f42dd7
Internal change.
...
PiperOrigin-RevId: 545770955
1 year ago
Nevena Kotlaja
ebcfaa5a17
Clean usages of grep_includes
...
PiperOrigin-RevId: 545224821
1 year ago
Protobuf Team Bot
ead5d565e7
Fix hazzer emission of Optional
...
We were always emitting Optional<T> for accessors, when they should've been behind `_opt`.
We've refactored our previous accessor into `getter` and `getter_opt`. We'll only emit `getter_opt` when we're dealing with optional fields.
PiperOrigin-RevId: 544087591
1 year ago
Protobuf Team Bot
68b34feb5a
Add support for int32 in V0.
...
Needed to lowercase fieldnames and add underscores when they use protected cpp names. Ended up using `cpp::FieldName` from the cpp impl to get this for free.
Also added escaping to Rust accessors, so that protected keywords will compile.
PiperOrigin-RevId: 543995050
1 year ago
Protobuf Team Bot
29a26156bb
Add SettableValue for generic field setting
...
This is a prerequisite for optional types to have proper setters.
PiperOrigin-RevId: 542588427
1 year ago
Protobuf Team Bot
263248e5b7
Add Optional, FieldEntry stubs for v0.6
...
This should get basic usage unblocked.
PiperOrigin-RevId: 542578731
1 year ago
Marcel Hlopko
f71a9263f9
Refine proxied traits instead of using bounds
...
PiperOrigin-RevId: 542492859
1 year ago
Protobuf Team Bot
0a45abe4c2
Internal Change
...
PiperOrigin-RevId: 540584719
1 year ago
Protobuf Team Bot
5a48187464
Move internal-only but kernel-agnostic paths into an `__internal` module
...
Add some documentation along the way.
PiperOrigin-RevId: 540311409
1 year ago
Protobuf Team Bot
381b31e9c9
Make ViewFor/MutFor use assoc. type instead of generic, rename to match
...
This implements the associated type change suggested by dmitrig@.
I don't foresee use cases that would make `ViewFor` allowing multiple `T` to be
useful, rather than confusing.
This also implements some suggested wording changes that I agree with.
PiperOrigin-RevId: 540024883
1 year ago
Marcel Hlopko
cc83427ee3
Do not pass nullptr to slice::from_raw_parts
...
Pass dangling, but well-aligned pointer instead as per
https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html#safety .
PiperOrigin-RevId: 539924021
1 year ago
Dmitri Gribenko
0246e09df8
Copy-edit comments in shared.rs
...
PiperOrigin-RevId: 539910433
1 year ago
Dmitri Gribenko
de21810745
Copy-edit comments in the BUILD file
...
PiperOrigin-RevId: 539901997
1 year ago
Marcel Hlopko
209accaf6f
Implement Proxied for v0.6
...
PiperOrigin-RevId: 539600447
1 year ago
Marcel Hlopko
c0c66ec1ea
Internal change
...
PiperOrigin-RevId: 538294711
2 years ago
Marcel Hlopko
ff750bb4c3
Put shared.rs and cpp.rs/upb.rs into the same crate.
...
The motivation is to make the setup simpler and more flexible.
PiperOrigin-RevId: 538189061
2 years ago
Marcel Hlopko
f92edc13c2
Automated rollback of commit fe7c4f9422
.
...
PiperOrigin-RevId: 538128679
2 years ago
Marcel Hlopko
fe7c4f9422
Simplify Protobuf Rust runtime build setup
...
PiperOrigin-RevId: 537300231
2 years ago
Marcel Hlopko
2f78ca72eb
Delete unnecessary TODO
...
We don't use todos to remind us that V0 needs to be replaced with V1.
PiperOrigin-RevId: 529377437
2 years ago
Marcel Hlopko
c58067fa70
Enable sanitizers
...
PiperOrigin-RevId: 529371786
2 years ago
Marcel Hlopko
db587750b9
Document the BUILD file setup
...
PiperOrigin-RevId: 529363264
2 years ago
Marcel Hlopko
993705bad1
Cleanup references to b/270125787
...
PiperOrigin-RevId: 529347892
2 years ago
Marcel Hlopko
701e056e2b
Zhuzh up the C++/Rust interop test to demonstrate more uses.
...
Taking over the work done by mcyoung@
PiperOrigin-RevId: 529063108
2 years ago
Jakob Buchgraber
a1b6dd9247
Implement Msg.deserialize() for the UPB kernel
...
PiperOrigin-RevId: 527496306
2 years ago
Jakob Buchgraber
0ecb729906
Implement 'bytes' accessors for UPB :)
...
Move the 'accessors_test.rs' to shared/ as both kernels now support the same accessor types.
PiperOrigin-RevId: 526591987
2 years ago
Miguel Young de la Sota
8e53046d94
Make protobuf_upb::Arena into a proper Rust RAII type.
...
PiperOrigin-RevId: 525775419
2 years ago
Jakob Buchgraber
44ac124713
Test nested messages support for UPB.
...
PiperOrigin-RevId: 525733570
2 years ago
Marcel Hlopko
e5679c01e8
Implement nested messages for v0 API for cpp kernel
...
PiperOrigin-RevId: 525372222
2 years ago
Marcel Hlopko
5091c9fd10
Enable sanitized CI builds
...
PiperOrigin-RevId: 524773049
2 years ago
Marcel Hlopko
a1ba8d238a
Generate bindings under the correct package.
...
Before this CL all messages were generated in the top-level crate module. With
this change we generate messages under the module specified by the package
declaration in the .proto file.
Dots are interpreted as submodule separator in consistency with how C++
namespaces are handled.
Note that name of the proto_library target still remains to be used as the crate name. This CL only adds crate submodules dependeing on the specified package.
PiperOrigin-RevId: 524235162
2 years ago
Marcel Hlopko
0a05e2f334
Implement bytes field accessors for v0 Rust API
...
PiperOrigin-RevId: 524089369
2 years ago
Marcel Hlopko
777f84f559
Implement bool and int64 field accessors for v0 Rust API
...
PiperOrigin-RevId: 523671732
2 years ago
Jakob Buchgraber
0bb76d70f7
Implement 'optional int64' accessors per v0 API spec.
...
PiperOrigin-RevId: 523667647
2 years ago
Marcel Hlopko
390b7f3e6f
Implement Msg::parse(&mut self) for V0 API.
...
PiperOrigin-RevId: 523665442
2 years ago
Jakob Buchgraber
c575758ad9
Implement accessors for 'optional bool' per v0 API spec
...
See 'accessors_test.rs' for the generated Rust API.
PiperOrigin-RevId: 523650122
2 years ago