pub struct WriteOptions {
pub profiles: ProfileMask,
pub id_style: IdStyle,
pub pretty: bool,
pub header: HeaderSource,
pub xml_declaration: bool,
}Expand description
Options controlling serialization.
Fields§
§profiles: ProfileMaskWrite only attributes belonging to these profiles; zero means “everything”.
A set, because one file often serves several (e.g. Equipment, Operation and ShortCircuit together).
id_style: IdStyle§pretty: boolIndent nested elements. Off produces smaller files.
header: HeaderSourceWhere the document’s md:FullModel comes from.
xml_declaration: boolEmit the XML declaration.
Implementations§
Source§impl WriteOptions
impl WriteOptions
Sourcepub fn profile(profile: ProfileId) -> WriteOptions
pub fn profile(profile: ProfileId) -> WriteOptions
Write one profile’s attributes, as a conforming instance file.
Sourcepub fn profiles(profiles: ProfileMask) -> WriteOptions
pub fn profiles(profiles: ProfileMask) -> WriteOptions
Write the attributes of every profile in profiles.
Sourcepub fn with_header(self, header: ModelHeader) -> Self
pub fn with_header(self, header: ModelHeader) -> Self
Write header rather than a derived one.
Sourcepub fn headerless(self) -> Self
pub fn headerless(self) -> Self
Write no header at all.
The result is not a conforming instance file. Use it for a fragment, or where the caller assembles the document itself.
pub fn with_id_style(self, style: IdStyle) -> Self
pub fn compact(self) -> Self
Trait Implementations§
Source§impl Clone for WriteOptions
impl Clone for WriteOptions
Source§impl Debug for WriteOptions
impl Debug for WriteOptions
Auto Trait Implementations§
impl Forget for WriteOptions
impl Freeze for WriteOptions
impl Move for WriteOptions
impl RefUnwindSafe for WriteOptions
impl Send for WriteOptionswhere
BoxRaw<ModelHeader>: Send,
impl Sync for WriteOptionswhere
BoxRaw<ModelHeader>: Sync,
impl Unpin for WriteOptions
impl UnsafeUnpin for WriteOptions
impl UnwindSafe for WriteOptionswhere
BoxRaw<ModelHeader>: UnwindSafe,
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