pub struct PortableDocument {
pub id: String,
pub root: String,
pub structure: BTreeMap<String, Vec<String>>,
pub blocks: BTreeMap<String, Block>,
pub metadata: DocumentMetadata,
pub version: u64,
}Expand description
Canonical JSON-safe representation of a Document.
This is the shared storage/interchange form for UCP documents and graph-backed workflows that need deterministic serialization.
Fields§
§id: String§root: String§structure: BTreeMap<String, Vec<String>>§blocks: BTreeMap<String, Block>§metadata: DocumentMetadata§version: u64Implementations§
Source§impl PortableDocument
impl PortableDocument
pub fn from_document(doc: &Document) -> PortableDocument
pub fn to_document(&self) -> Result<Document, Error>
Trait Implementations§
Source§impl Clone for PortableDocument
impl Clone for PortableDocument
Source§fn clone(&self) -> PortableDocument
fn clone(&self) -> PortableDocument
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PortableDocument
impl Debug for PortableDocument
Source§impl<'de> Deserialize<'de> for PortableDocument
impl<'de> Deserialize<'de> for PortableDocument
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PortableDocument, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PortableDocument, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for PortableDocument
impl Serialize for PortableDocument
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for PortableDocument
impl RefUnwindSafe for PortableDocument
impl Send for PortableDocument
impl Sync for PortableDocument
impl Unpin for PortableDocument
impl UnsafeUnpin for PortableDocument
impl UnwindSafe for PortableDocument
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more