dpp/document/serialization_traits/cbor_conversion/v0/
mod.rs1use crate::version::PlatformVersion;
2use crate::ProtocolError;
3use ciborium::Value as CborValue;
4
5pub trait DocumentCborMethodsV0 {
6 fn from_cbor(
9 document_cbor: &[u8],
10 document_id: Option<[u8; 32]>,
11 owner_id: Option<[u8; 32]>,
12 platform_version: &PlatformVersion,
13 ) -> Result<Self, ProtocolError>
14 where
15 Self: Sized;
16 fn to_cbor_value(&self) -> Result<CborValue, ProtocolError>;
17 fn to_cbor(&self) -> Result<Vec<u8>, ProtocolError>;
19}