OVSDB Derive
A procedural macro crate for Rust to generate code for OVSDB table structs.
Overview
This crate provides two approaches for working with OVSDB tables:
#[ovsdb_object]attribute macro: Automatically adds_uuidand_versionfields to your struct#[derive(OVSDB)]derive macro: requires manual fields but offers more control
Usage
You can either use the attribute macro or the derive macro to generate code for your OVSDB table structs. For more details
on how to use the library, check out the examples in the examples directory.
Attribute Macro (Recommended)
use ovsdb_object;
use HashMap;
Derive Macro (Alternative)
use OVSDB;
use HashMap;
use Uuid;
Generated Code
Both macros generate the following implementations:
new()method that creates a new instance with default valuesto_map()method that converts the struct to a HashMap for OVSDB serializationfrom_map()method that creates a struct from a HashMap received from OVSDBDefaulttrait implementationserde::Serializetrait implementationserde::Deserializetrait implementation
License
This project is licensed under the Apache License, Version 2.0.