| Crates.io | tucana |
| lib.rs | tucana |
| version | 0.0.35 |
| created_at | 2024-11-19 20:44:46.079104+00 |
| updated_at | 2025-09-20 15:05:35.955837+00 |
| description | The rust crate for the internal gRPC communication of Code0 |
| homepage | https://code0.tech |
| repository | https://github.com/code0-tech/tucana |
| max_upload_size | |
| id | 1453849 |
| size | 276,110 |
The Rust Code0 gRPC library (for internal service communication) providing interfaces for internal service communication along with helper utilities for working with the generated types.
Tucana serves as the interface layer for internal service communication:
The library provides utilities for working with the Protobuf-generated types, especially the Value and Struct (JSON representations) types used throughout the services.
Access nested values in complex Protobuf message structures using dot notation:
use tucana::shared::helper::path;
use tucana::shared::Value;
// Get values of specific types from Protobuf messages
let flow_type = path::get_string("type", &flow_value);
let project_id = path::get_number("project_id", &flow_value);
let has_starting_node = path::exists_path("starting_node", &flow_value);
// Update values in a message
let updated_flow = path::set_value("input_type_identifier", &flow_value, new_type_value);
Convert between Protobuf messages and JSON for debugging or external interfaces:
use tucana::shared::helper::value;
use tucana::shared::Flow;
use serde_json;
// Create a Flow message
let flow = Flow {
flow_id: 42,
project_id: 100,
r#type: "process".to_string(),
data_types: vec![],
input_type_identifier: Some("String".to_string()),
return_type_identifier: Some("Number".to_string()),
settings: vec![],
starting_node: None,
};
// Serialize to JSON
let flow_json = serde_json::to_string(&flow).expect("Serialization failed");
// Parse back from JSON
let parsed_flow: Flow = serde_json::from_str(&flow_json).expect("Deserialization failed");