mirror of
https://github.com/fluencelabs/interface-types
synced 2024-12-04 15:20:20 +00:00
feat(interface-types) Implement From<&Vec<InterfaceValue>>
for RecordType
.
This commit is contained in:
parent
576bf74b28
commit
3f48740c06
@ -69,9 +69,7 @@ impl From<&InterfaceValue> for InterfaceType {
|
||||
//InterfaceValue::Anyref(_) => Self::Anyref,
|
||||
InterfaceValue::I32(_) => Self::I32,
|
||||
InterfaceValue::I64(_) => Self::I64,
|
||||
InterfaceValue::Record(values) => Self::Record(RecordType {
|
||||
fields: values.iter().map(Into::into).collect(),
|
||||
}),
|
||||
InterfaceValue::Record(values) => Self::Record(values.into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -82,6 +80,14 @@ impl Default for InterfaceValue {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&Vec<InterfaceValue>> for RecordType {
|
||||
fn from(values: &Vec<InterfaceValue>) -> Self {
|
||||
RecordType {
|
||||
fields: values.iter().map(Into::into).collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents a native type supported by WIT.
|
||||
pub trait NativeType {
|
||||
/// The associated interface type that maps to the native type.
|
||||
|
Loading…
Reference in New Issue
Block a user