Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
More protobuf conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
vigoo committed Oct 7, 2024
1 parent 4c12a23 commit e0ec424
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions wasm-rpc/src/type_annotated_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ impl TryFrom<crate::protobuf::TypeAnnotatedValue> for ValueAndType {
}
}

impl TryFrom<ValueAndType> for crate::protobuf::TypeAnnotatedValue {
type Error = Vec<String>;

fn try_from(value_and_type: ValueAndType) -> Result<Self, Self::Error> {
Ok(crate::protobuf::TypeAnnotatedValue {
type_annotated_value: Some(value_and_type.try_into()?),
})
}
}

/// Specific trait to convert a type into a `ValueAndType` type.
pub trait IntoValue {
fn into_value(self) -> Value;
Expand Down

0 comments on commit e0ec424

Please sign in to comment.