1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/// Get the externally-visible name of the specified item, if any.
///
/// Most Rust items do not have an externally-visible name. Only items intended
/// to be called or accessed from "outside" the program via FFI have external names,
/// which are set in one of the following ways:
///
/// For functions:
/// ```rust
/// #[unsafe(no_mangle)] // visible as `externally_visible`
/// fn externally_visible() {}
///
/// #[unsafe(export_name = "also_externally_visible")]
/// fn internal_name() {}
/// ```
///
/// For statics:
/// ```rust
/// #[unsafe(no_mangle)] // visible as `VAR1`
/// static VAR1: i32 = 42;
///
/// #[unsafe(export_name = "EXTERNALLY_VISIBLE")] // visible as `EXTERNALLY_VISIBLE`
/// static VAR2: i32 = 42;
/// ```
///
/// For all other functions/statics, this function returns `None`.
/// If this function is called with an item that doesn't support external names,
/// the result is unspecified.
pub