dxfbin 0.1.0

Streaming text DXF to binary DXF converter
Documentation
// SPDX-License-Identifier: ISC
/// A typed receiver of DXF group data.
///
/// Each method corresponds to a DXF value type. The `group_code` method is
/// called before the corresponding value method for each group.
pub trait Sink {
    type Error;

    /// Write the binary DXF sentinel header.
    fn sentinel(&mut self) -> Result<(), Self::Error>;

    /// Write a group code.
    fn group_code(&mut self, code: u16) -> Result<(), Self::Error>;

    /// Write a string value (raw bytes, no null terminator).
    fn string(&mut self, value: &[u8]) -> Result<(), Self::Error>;

    /// Write a boolean value.
    fn boolean(&mut self, value: bool) -> Result<(), Self::Error>;

    /// Write a 16-bit integer value.
    fn int16(&mut self, value: i16) -> Result<(), Self::Error>;

    /// Write a 32-bit integer value.
    fn int32(&mut self, value: i32) -> Result<(), Self::Error>;

    /// Write a 64-bit integer value.
    fn int64(&mut self, value: i64) -> Result<(), Self::Error>;

    /// Write a double-precision floating-point value.
    fn double(&mut self, value: f64) -> Result<(), Self::Error>;

    /// Write a binary chunk (raw decoded bytes, not hex).
    fn binary_chunk(&mut self, data: &[u8]) -> Result<(), Self::Error>;
}