1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
//! Traits used in gerber-types.
use std::io::Write;
use crate::GerberResult;
/// All types that implement this trait can be converted to a complete Gerber
/// Code line. Generated code should end with a newline.
pub trait GerberCode<W: Write> {
fn serialize(&self, writer: &mut W) -> GerberResult<()>;
}
/// All types that implement this trait can be converted to a Gerber Code
/// representation.
///
/// This is a crate-internal trait.
pub trait PartialGerberCode<W: Write> {
fn serialize_partial(&self, writer: &mut W) -> GerberResult<()>;
}