interoptopus_proc_impl 0.16.0-alpha.10

Macros to produce Interoptopus item info.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use syn::Attribute;

/// Check if an attribute is `#[ffi::skip]`
pub fn is_ffi_skip_attribute(attr: &Attribute) -> bool {
    if let syn::Meta::Path(path) = &attr.meta {
        path.segments.len() == 2 && path.segments[0].ident == "ffi" && path.segments[1].ident == "skip"
    } else {
        false
    }
}

/// Check if any attribute in a slice is `#[ffi::skip]`
pub fn has_ffi_skip_attribute(attrs: &[Attribute]) -> bool {
    attrs.iter().any(is_ffi_skip_attribute)
}