pub struct StepReader { /* private fields */ }Expand description
A STEP codec carrying an explicit parse policy.
Implementations§
Source§impl StepReader
impl StepReader
Sourcepub const fn new(options: ParseOptions) -> Self
pub const fn new(options: ParseOptions) -> Self
A reader applying options.
Sourcepub const fn on_malformed_record(self, policy: OnMalformed) -> Self
pub const fn on_malformed_record(self, policy: OnMalformed) -> Self
Sets the malformed-record policy.
Sourcepub const fn options(&self) -> ParseOptions
pub const fn options(&self) -> ParseOptions
The policy this reader applies.
Trait Implementations§
Source§impl Clone for StepReader
impl Clone for StepReader
Source§impl Codec for StepReader
impl Codec for StepReader
Source§fn read_path(&self, path: &Path) -> Result<Model, ModelError>
fn read_path(&self, path: &Path) -> Result<Model, ModelError>
Memory-maps the file rather than reading it into a heap buffer.
Large models are hundreds of megabytes; mapping avoids a full copy and lets the OS page in only what the parse touches.
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_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 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.
impl Copy for StepReader
Source§impl Debug for StepReader
impl Debug for StepReader
Auto Trait Implementations§
impl Freeze for StepReader
impl RefUnwindSafe for StepReader
impl Send for StepReader
impl Sync for StepReader
impl Unpin for StepReader
impl UnsafeUnpin for StepReader
impl UnwindSafe for StepReader
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