```rs #[derive(Debug, Clone, Serialize)] #[serde(tag = "t", content = "c")] pub enum MaterialParamet

#[derive(Debug, Clone, Serialize)]
#[serde(tag = "t", content = "c")]
pub enum MaterialParameter {
Float(f32),
Vector2(Vector2<f32>),
Vector3(Vector3<f32>),
Vector4(Vector4<f32>),
Color([f32; 4]),
Int(i32),
Int2(Vector2<i32>),
Int3(Vector3<i32>),
Int4(Vector4<i32>),
Bool(bool),
UInt(u32),
UInt2(Vector2<u32>),
UInt3(Vector3<u32>),
UInt4(Vector4<u32>),
Matrix(ColumnMatrix4<f32>),
Texture(ResourceID),
}
#[derive(Debug, Clone, Serialize)]
#[serde(tag = "t", content = "c")]
pub enum MaterialParameter {
Float(f32),
Vector2(Vector2<f32>),
Vector3(Vector3<f32>),
Vector4(Vector4<f32>),
Color([f32; 4]),
Int(i32),
Int2(Vector2<i32>),
Int3(Vector3<i32>),
Int4(Vector4<i32>),
Bool(bool),
UInt(u32),
UInt2(Vector2<u32>),
UInt3(Vector3<u32>),
UInt4(Vector4<u32>),
Matrix(ColumnMatrix4<f32>),
Texture(ResourceID),
}
7 Replies
Nova
NovaOP2y ago
this works fine as does
#[derive(Debug, Clone, Deserialize)]
#[serde(tag = "type", content = "content")]
pub enum RequestedState {
Maximize(bool),
Fullscreen(bool),
Minimize,
Move,
Resize(Edge),
}
#[derive(Debug, Clone, Deserialize)]
#[serde(tag = "type", content = "content")]
pub enum RequestedState {
Maximize(bool),
Fullscreen(bool),
Minimize,
Move,
Resize(Edge),
}
otterpip
otterpip2y ago
the second one works fine? try to deserialize specifically RequestedState::Minimize
Nova
NovaOP2y ago
yea that's worked for months oh hmm
otterpip
otterpip2y ago
because it might be because some of the units have one tuple parameter and some of them are just unit variants
Nova
NovaOP2y ago
@otterpip confirmed that it's the case so... that's fun it's just unit variants so deserializing unit variants must be the problem also if you haven't already, would appreciate the name of the crate for the stardust common structs to be "spec"
otterpip
otterpip2y ago
okie got it and flexbuffers or no? i can look at the other crates for reference if i need
Nova
NovaOP2y ago
yea so the idea would be to move the flatbuffers stuff from schemas to spec, maybe move the flex serialization/deserialization to core and then have all the structs that represent arguments and such be in spec

Did you find this page helpful?