| 36 | |
| 37 | impl From<Type> for wasmtime_component_valtype_t { |
| 38 | fn from(item: Type) -> Self { |
| 39 | match item { |
| 40 | Type::Bool => Self::Bool, |
| 41 | Type::S8 => Self::S8, |
| 42 | Type::S16 => Self::S16, |
| 43 | Type::S32 => Self::S32, |
| 44 | Type::S64 => Self::S64, |
| 45 | Type::U8 => Self::U8, |
| 46 | Type::U16 => Self::U16, |
| 47 | Type::U32 => Self::U32, |
| 48 | Type::U64 => Self::U64, |
| 49 | Type::Float32 => Self::F32, |
| 50 | Type::Float64 => Self::F64, |
| 51 | Type::Char => Self::Char, |
| 52 | Type::String => Self::String, |
| 53 | Type::List(ty) => Self::List(Box::new(ty.into())), |
| 54 | Type::Record(ty) => Self::Record(Box::new(ty.into())), |
| 55 | Type::Tuple(ty) => Self::Tuple(Box::new(ty.into())), |
| 56 | Type::Variant(ty) => Self::Variant(Box::new(ty.into())), |
| 57 | Type::Enum(ty) => Self::Enum(Box::new(ty.into())), |
| 58 | Type::Option(ty) => Self::Option(Box::new(ty.into())), |
| 59 | Type::Result(ty) => Self::Result(Box::new(ty.into())), |
| 60 | Type::Flags(ty) => Self::Flags(Box::new(ty.into())), |
| 61 | Type::Own(ty) => Self::Own(Box::new(ty.into())), |
| 62 | Type::Borrow(ty) => Self::Borrow(Box::new(ty.into())), |
| 63 | Type::Future(ty) => Self::Future(Box::new(ty.into())), |
| 64 | Type::Stream(ty) => Self::Stream(Box::new(ty.into())), |
| 65 | Type::Map(ty) => Self::Map(Box::new(ty.into())), |
| 66 | Type::ErrorContext => Self::ErrorContext, |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | #[unsafe(no_mangle)] |