diff --git a/oca/src/facade/bundle.rs b/oca/src/facade/bundle.rs index bec6325..6651be6 100644 --- a/oca/src/facade/bundle.rs +++ b/oca/src/facade/bundle.rs @@ -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; + +pub fn load_oca(source: &mut dyn Read) -> Result { + let oca: Bundle = serde_json::from_reader(source)?; + Ok(oca) +} + #[derive(Debug)] pub enum BundleElement { Structural(StructuralBundle),