Skip to main content

expose

Attribute Macro expose 

#[expose]
Expand description

Registers the public functions and constants of an inherent impl block, the public fields of a struct, the variants of an enum or the public functions of an inline module, behind the live feature of the crate it is used in. It generates __live_expose (or __live_expose_<part> with part = "...") on the type, or inside the module, which the crate calls when it builds its registry. skip = "a, b" leaves functions out.

Generic parameters bounded by View become AnyView, and by ViewSeq a Vec<AnyView>; with = "A = (); A = Other" registers a block once for each of these types. A function’s own parameters bounded by Into, AsRef, Fn or IntoIterator take what those take, and ones bounded only by Clone, PartialEq or Debug take any value. What it cannot call with interpreter values is left out without failing the build.