fn_meta 0.1.0

Returns metadata about a function.
Documentation

🧬 FnMeta

Crates.io docs.rs CI Coverage Status

Returns metadata about a function.

Examples

use fn_meta::FnMetadataExt;

fn my_function(_: &S0, _: &mut S1, _: &S2) -> () {}

let fn_metadata = my_function.meta();

assert_eq!(
    alloc::vec![TypeId::of::<S0>(), TypeId::of::<S2>()],
    fn_metadata.reads()
);
assert_eq!(alloc::vec![TypeId::of::<S1>()], fn_metadata.writes());

struct S0;
struct S1;
struct S2;

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.