pub struct XmlCodec { /* private fields */ }Expand description
The ifcXML codec.
Construct with XmlCodec::default for the lossless compatibility dialect,
XmlCodec::strict for an exact namespace/release profile, or
XmlCodec::with_schema_and_profile for strict output with schema-correct
attribute names.
Implementations§
Source§impl XmlCodec
impl XmlCodec
Sourcepub const fn strict(profile: XmlProfile) -> Self
pub const fn strict(profile: XmlProfile) -> Self
A codec that enforces one exact ifcXML release namespace and schema token.
Sourcepub const fn profile(&self) -> Option<XmlProfile>
pub const fn profile(&self) -> Option<XmlProfile>
The strict release profile, or None for compatibility mode.
Sourcepub fn with_schema(schema: Arc<Schema>) -> Self
pub fn with_schema(schema: Arc<Schema>) -> Self
A codec that emits schema-correct attribute names.
Sourcepub fn with_schema_and_profile(schema: Arc<Schema>, profile: XmlProfile) -> Self
pub fn with_schema_and_profile(schema: Arc<Schema>, profile: XmlProfile) -> Self
A strict release-profile codec with schema-backed attribute names.
Trait Implementations§
Source§impl Codec for XmlCodec
impl Codec for XmlCodec
Source§fn extensions(&self) -> &'static [&'static str]
fn extensions(&self) -> &'static [&'static str]
Conventional file extensions, lower-case, without the dot.
Source§fn detect(&self, bytes: &[u8]) -> bool
fn detect(&self, bytes: &[u8]) -> bool
Does this look like a file this codec can read? Read more
Source§fn read_bytes(&self, bytes: &[u8]) -> Result<Model, ModelError>
fn read_bytes(&self, bytes: &[u8]) -> Result<Model, ModelError>
Parse a model from bytes. Read more
Source§fn write(&self, model: &Model, out: &mut dyn Write) -> Result<(), ModelError>
fn write(&self, model: &Model, out: &mut dyn Write) -> Result<(), ModelError>
Serialize a model.
Source§fn read_owned(&self, bytes: Vec<u8>) -> Result<Model, ModelError>
fn read_owned(&self, bytes: Vec<u8>) -> Result<Model, ModelError>
Parse a model from a buffer the model may keep. Read more
Source§fn read_from(&self, reader: &mut dyn Read) -> Result<Model, ModelError>
fn read_from(&self, reader: &mut dyn Read) -> Result<Model, ModelError>
Parse from any reader. Override when the format can stream.
Source§fn read_path(&self, path: &Path) -> Result<Model, ModelError>
fn read_path(&self, path: &Path) -> Result<Model, ModelError>
Parse a file from disk. Read more
Source§fn write_path(&self, model: &Model, path: &Path) -> Result<(), ModelError>
fn write_path(&self, model: &Model, path: &Path) -> Result<(), ModelError>
Serialize to a file on disk.
Source§fn write_bytes(&self, model: &Model) -> Result<Vec<u8>, ModelError>
fn write_bytes(&self, model: &Model) -> Result<Vec<u8>, ModelError>
Serialize to a byte vector.
Auto Trait Implementations§
impl Freeze for XmlCodec
impl RefUnwindSafe for XmlCodec
impl Send for XmlCodec
impl Sync for XmlCodec
impl Unpin for XmlCodec
impl UnsafeUnpin for XmlCodec
impl UnwindSafe for XmlCodec
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