Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions content/reference/rust/rust-generated.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,11 @@ The compiler generates the following accessor methods:
* `fn has_foo(&self) -> bool`: Returns `true` if the field is set.
* `fn foo(&self) -> i32`: Returns the current value of the field. If the field
is not set, it returns the default value.
* fn foo_opt(&self) -> protobuf::Optional<i32>`: Returns an optional with the
variant`Set(value)`if the field is set or`Unset(default value)`if it's
unset. See [`Optional`
rustdoc](https://docs.rs/protobuf/4.33.5-release/protobuf/enum.Optional.html)
* `fn foo_opt(&self) -> protobuf::Optional<i32>`: Returns an optional with the
variant `Set(value)` if the field is set or `Unset(default value)` if it's
unset. See
[`Optional`](https://docs.rs/protobuf/4.33.5-release/protobuf/enum.Optional.html)
rustdoc.
* `fn set_foo(&mut self, val: i32)`: Sets the value of the field. After
calling this, `has_foo()` will return `true` and `foo()` will return
`value`.
Expand Down