Skip to content

Commit

Permalink
Add intro to generated Rust in README
Browse files Browse the repository at this point in the history
  • Loading branch information
duskmoon314 committed Jun 16, 2024
1 parent d243405 commit e874d29
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,11 @@ processes.
approve.

When updating the Protobuf files in a pull request, you will also need to update
the generated Go and Python files, which are hosted in this repository under
[go/](go/) and [py/](py/). This can be done easily by running `./codegen/update.sh`,
provided docker is installed and your user is part of the "docker" group
(which means that the `docker` command can be executed without `sudo`).
the generated Go, Python and Rust files, which are hosted in this repository
under [go/](go/), [py/](py/) and [rust/](rust/). This can be done easily by
running `./codegen/update.sh`, provided docker is installed and your user is
part of the "docker" group (which means that the `docker` command can be
executed without `sudo`).

## Use generated P4Runtime library

Expand Down Expand Up @@ -177,6 +178,29 @@ pip3 install p4runtime
pip3 install p4runtime==1.3.0
```

### Rust

To include the P4Runtime Rust crate to your project, use the `cargo` command:

```bash
cargo add p4runtime
```

Or add the following to your `Cargo.toml` file:

```toml
[dependencies]
p4runtime = "1.3.0"
```

Or add this repository url to your `Cargo.toml` file if you want to use the
latest version:

```toml
[dependencies]
p4runtime = { git = "https://github.com/p4lang/p4runtime.git" }
```

## Guidelines for using Protocol Buffers (protobuf) in backwards-compatible ways

P4Runtime generally follows "Live at Head" development principles - new
Expand Down

0 comments on commit e874d29

Please sign in to comment.