pub struct Document { /* private fields */ }Expand description
One IFCX file held by a host.
The host keeps this handle rather than a plain object, so writing it back
is lossless: key order, unknown fields, null deletions and every number
stay exactly as read, which a JavaScript object would not guarantee.
Implementations§
Source§impl Document
impl Document
Sourcepub fn parse(bytes: &[u8]) -> Result<Self, BindingError>
pub fn parse(bytes: &[u8]) -> Result<Self, BindingError>
Reads an IFCX file from its UTF-8 JSON bytes.
Sourcepub fn write(&self, pretty: bool) -> Result<String, BindingError>
pub fn write(&self, pretty: bool) -> Result<String, BindingError>
The file as JSON text: compact, or indented by two spaces.
Sourcepub fn header_json(&self) -> Result<String, BindingError>
pub fn header_json(&self) -> Result<String, BindingError>
The header object as JSON text.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Number of entries in data. Several may share a path.
Sourcepub fn validate_json(&self) -> String
pub fn validate_json(&self) -> String
Checks every attribute against this file’s own schemas and returns
the report as JSON text (see LayerSet::validate_json for the
shape). Imports are not resolved, so an attribute whose schema lives
only in an imported file is reported as missing-schema.
Trait Implementations§
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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