rust-lang / rust-lang/rust-bindgen

docummenting of usage dynamic_library_name

Open
#2,775 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
5.3k
Forks
829
Avg merge
1d 1h
Merged PRs (30d)
15

Description

hello could you write in the docummentation or give me example how to use method dynamic_library_name to be able to include libloading after generating wrapper?

Input C/C++ Header
// Insert your minimal C or C++ header here.
//
// It should *NOT* have any `#include`s! Not all systems have the same header
// files, and therefore any `#include` harms reproducibility. Additionally,
// the test case isn't minimal since the included file almost assuredly
// contains things that aren't necessary to reproduce the bug, and makes
// tracking it down much more difficult.
//
// Use the `--dump-preprocessed-input` flag or the
// `bindgen::Builder::dump_preprocessed_input` method to make your test case
// standalone and without `#include`s, and then use C-Reduce to minimize it:
// https://github.com/rust-lang/rust-bindgen/blob/master/CONTRIBUTING.md#using-creduce-to-minimize-test-cases
Bindgen Invocation
bindgen::Builder::default()
    .header("input.h")
    .generate()
    .unwrap()

or

$ bindgen input.h --whatever --flags
Actual Results
Insert panic message and backtrace (set the `RUST_BACKTRACE=1` env var) here.

and/or

// Insert the (incorrect/buggy) generated bindings here

and/or

Insert compilation errors generated when compiling the bindings with rustc here
Expected Results

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the bindgen documentation and API references for dynamic_library_name and review how generated wrappers are intended to work with libloading. Add a concise usage example showing the method in that workflow, then verify that the example accurately reflects the public API and explains the expected generated result.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.