Skip to content

Commit

Permalink
feat(torii-grpc): add list to member value enum for usage in sdk (#2828)
Browse files Browse the repository at this point in the history
* feat(torii-grpc): add list to member value enum for usasge in sdk

* fmt
  • Loading branch information
Larkooo authored Dec 23, 2024
1 parent 3c32891 commit 845c5b1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/torii/grpc/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ pub enum PatternMatching {
pub enum MemberValue {
Primitive(Primitive),
String(String),
List(Vec<MemberValue>),
}

#[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)]
Expand Down Expand Up @@ -418,6 +419,14 @@ impl From<MemberValue> for member_value::ValueType {
member_value::ValueType::Primitive(primitive.into())
}
MemberValue::String(string) => member_value::ValueType::String(string),
MemberValue::List(list) => {
member_value::ValueType::List(proto::types::MemberValueList {
values: list
.into_iter()
.map(|v| proto::types::MemberValue { value_type: Some(v.into()) })
.collect(),
})
}
}
}
}
Expand Down

0 comments on commit 845c5b1

Please sign in to comment.