Skip to main content

XmlCodec

Struct XmlCodec 

Source
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

Source

pub const fn strict(profile: XmlProfile) -> Self

A codec that enforces one exact ifcXML release namespace and schema token.

Source

pub const fn profile(&self) -> Option<XmlProfile>

The strict release profile, or None for compatibility mode.

Source

pub fn with_schema(schema: Arc<Schema>) -> Self

A codec that emits schema-correct attribute names.

Source

pub fn with_schema_and_profile(schema: Arc<Schema>, profile: XmlProfile) -> Self

A strict release-profile codec with schema-backed attribute names.

Source

pub fn schema(&self) -> Option<&Schema>

The schema in use, if any.

Trait Implementations§

Source§

impl Codec for XmlCodec

Source§

fn name(&self) -> &'static str

Human-readable name for diagnostics, e.g. STEP.
Source§

fn extensions(&self) -> &'static [&'static str]

Conventional file extensions, lower-case, without the dot.
Source§

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>

Parse a model from bytes. Read more
Source§

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>

Parse a model from a buffer the model may keep. Read more
Source§

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>

Parse a file from disk. Read more
Source§

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>

Serialize to a byte vector.
Source§

impl Default for XmlCodec

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.