mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-28 04:01:33 +00:00
Add support for optional numbers
This commit is contained in:
committed by
Alex Crichton
parent
2a6d98a6c9
commit
c49c18826d
@ -154,7 +154,27 @@ impl Descriptor {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_64bit(&self) -> Option<bool> {
|
||||
pub fn is_primitive(&self) -> bool {
|
||||
match *self {
|
||||
Descriptor::I32
|
||||
| Descriptor::U32
|
||||
| Descriptor::F32
|
||||
| Descriptor::F64 => true,
|
||||
_ => return false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_as_u32(&self) -> bool {
|
||||
match *self {
|
||||
Descriptor::I8
|
||||
| Descriptor::U8
|
||||
| Descriptor::I16
|
||||
| Descriptor::U16 => true,
|
||||
_ => return false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_64(&self) -> Option<bool> {
|
||||
match *self {
|
||||
Descriptor::I64 => Some(true),
|
||||
Descriptor::U64 => Some(false),
|
||||
|
Reference in New Issue
Block a user