Skip to content

Commit

Permalink
feat: add load_oca function to deserialize OCA bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
olichwiruk committed Dec 11, 2024
1 parent 554e8b7 commit caef016
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions oca/src/facade/bundle.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
use std::io::Read;

use oca_bundle_semantics::state::oca::OCABundle as StructuralBundle;
use said::derivation::HashFunctionCode;
use said::{sad::SerializationFormats, sad::SAD};
use said::version::SerializationInfo;
use serde::{Deserialize, Serialize};

pub type GenericError = Box<dyn std::error::Error + Sync + Send>;

pub fn load_oca(source: &mut dyn Read) -> Result<Bundle, GenericError> {
let oca: Bundle = serde_json::from_reader(source)?;
Ok(oca)
}

#[derive(Debug)]
pub enum BundleElement {
Structural(StructuralBundle),
Expand Down

0 comments on commit caef016

Please sign in to comment.