From 9f7230eeb0615254098d370b53789b4b3e0e2327 Mon Sep 17 00:00:00 2001 From: Romain Thomas Date: Sun, 21 Jul 2024 09:30:22 +0200 Subject: [PATCH] Update doc --- api/rust/cargo/README.md | 33 +++++++++++++++++++++++++++++++++ api/rust/cargo/lief/Cargo.toml | 17 +++++++++++------ doc/sphinx/api/rust/index.rst | 6 ------ 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/api/rust/cargo/README.md b/api/rust/cargo/README.md index de1054d828..ff7da54cb8 100644 --- a/api/rust/cargo/README.md +++ b/api/rust/cargo/README.md @@ -1 +1,34 @@ # LIEF Rust Bindings + +These are the offical rust bindings for LIEF. + +![LIEF Architecture](https://raw.githubusercontent.com/lief-project/LIEF/main/.github/images/architecture.png) + +## Getting Started + +```toml +[dependencies] +lief = = "0.15.0" +``` + +The bindings require Rust edition 2021 and `rustc >= 1.74.0` + +```rust +use lief; + +if let Some(lief::Binary::ELF(elf)) = lief::Binary::from(&mut file) { + println!("Dependencies:"); + for entry in elf.dynamic_entries() { + if let dynamic::Entries::Library(lib) = entry { + println!(" - {}", lib.name()); + } + } + println!("Versions:"); + for version in elf.symbols_version_requirement() { + println!(" From {}", version.name()); + for aux in version.auxiliary_symbols() { + println!(" - {}", aux.name()); + } + } +} +``` diff --git a/api/rust/cargo/lief/Cargo.toml b/api/rust/cargo/lief/Cargo.toml index f11de6fcde..91dd957491 100644 --- a/api/rust/cargo/lief/Cargo.toml +++ b/api/rust/cargo/lief/Cargo.toml @@ -1,10 +1,15 @@ [package] -name = "lief" -description = "Official Rust bindings for LIEF" -edition = "2021" -version.workspace = true -authors.workspace = true -license.workspace = true +name = "lief" +description = "Official Rust bindings for LIEF" +edition = "2021" +version.workspace = true +authors.workspace = true +license.workspace = true +readme.workspace = true +homepage.workspace = true +keywords.workspace = true +repository.workspace = true +categories.workspace = true [lib] doctest = false diff --git a/doc/sphinx/api/rust/index.rst b/doc/sphinx/api/rust/index.rst index a5c25db288..37a2bd0e43 100644 --- a/doc/sphinx/api/rust/index.rst +++ b/doc/sphinx/api/rust/index.rst @@ -3,12 +3,6 @@ :fa:`brands fa-rust` Rust ====================================== -.. warning:: - - LIEF Rust bindings are still in a beta version and not published yet on crate.io. - Thus, you should specify LIEF as a dependency of your project using - ``git`` or ``path`` while the binding are not officially released. - .. code-block:: toml [package]