diff options
Diffstat (limited to 'libbindgen/src/ir/ty.rs')
-rw-r--r-- | libbindgen/src/ir/ty.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libbindgen/src/ir/ty.rs b/libbindgen/src/ir/ty.rs index e83ef4fd..c1ed5b64 100644 --- a/libbindgen/src/ir/ty.rs +++ b/libbindgen/src/ir/ty.rs @@ -123,6 +123,14 @@ impl Type { } } + /// Is this an enum type? + pub fn is_enum(&self) -> bool { + match self.kind { + TypeKind::Enum(..) => true, + _ => false, + } + } + /// Is this either a builtin or named type? pub fn is_builtin_or_named(&self) -> bool { match self.kind { |