Skip to main content

ranvier_core/
metadata.rs

1use serde::{Deserialize, Serialize};
2use uuid::Uuid;
3
4#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5pub struct StepMetadata {
6    pub id: Uuid,
7    pub label: String,
8    pub description: Option<String>,
9    pub inputs: Vec<TypeInfo>,
10    pub outputs: Vec<TypeInfo>,
11}
12
13impl StepMetadata {
14    pub fn to_json(&self) -> serde_json::Value {
15        serde_json::to_value(self).unwrap_or(serde_json::Value::Null)
16    }
17}
18
19#[derive(Debug, Clone, Serialize, Deserialize)]
20pub struct TypeInfo {
21    pub name: String,
22    // Additional type metadata can be added here
23}
24
25impl TypeInfo {
26    pub fn new(name: impl Into<String>) -> Self {
27        Self { name: name.into() }
28    }
29}