runar-schemas
Shared schema and metadata types for the Runar framework (e.g., ServiceMetadata, ActionMetadata, FieldSchema).
Install
[]
= "0.1"
Usage
use ;
let action = ActionMetadata ;
let svc = ServiceMetadata ;
Schemas
-
ActionMetadata
- name: String
- description: String
- input_schema: Option
- output_schema: Option
-
SubscriptionMetadata
- path: String
-
ServiceMetadata
- network_id: String
- service_path: String
- name: String
- version: String
- description: String
- actions: Vec
- registration_time: u64
- last_start_time: Option
-
NodeMetadata
- services: Vec
- subscriptions: Vec
-
SchemaDataType
- String, Int32, Int64, Float, Double, Boolean, Timestamp, Binary
- Object, Array, Reference(String), Union(Vec), Any
-
FieldSchema
- name: String
- data_type: SchemaDataType
- description: Option
- nullable: Option
- default_value: Option
- properties: Option<HashMap<String, Box>> // for Object
- required: Option<Vec> // for Object
- items: Option<Box> // for Array
- pattern: Option
- enum_values: Option<Vec>
- minimum/maximum/exclusive_minimum/exclusive_maximum: Option<..>
- min_length/max_length/min_items/max_items: Option<..>
- example: Option
Constructors
use ;
use HashMap;
// Primitives
let s = string;
let i = integer;
let l = long;
let f = float;
let d = double;
let b = boolean;
let t = timestamp;
// Object with properties and required fields
let mut props = new;
props.insert;
props.insert;
let obj = object;
// Array of strings
let arr = array;
// Reference and union
let r = reference;
let u = union;
MSRV
Rust 1.70.0
License
MIT. See LICENSE.