oca-sdk-rs 2.0.0

Comprehensive SDK for OCA Bundle management and integration
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::fs;

use oca_sdk_rs::*;

fn main() {
    let bundle_path = "tests/assets/semantics/structural_bundle2.json";
    let bundle_str = fs::read_to_string(bundle_path).expect("failed to read bundle");

    let registry = oca::overlay_file::OverlayLocalRegistry::from_dir("tests/assets/overlay-file/")
        .expect("load overlays");
    let bundle = oca::bundle::load(&mut bundle_str.as_bytes(), &registry).expect("load bundle");

    println!("Loaded bundle with digest: {:?}", bundle.digest);
}