[][src]Trait dicom_encoding::encode::BasicEncode

pub trait BasicEncode {
    fn endianness(&self) -> Endianness;
fn encode_us<S>(&self, to: S, value: u16) -> Result<()>
    where
        S: Write
;
fn encode_ul<S>(&self, to: S, value: u32) -> Result<()>
    where
        S: Write
;
fn encode_ss<S>(&self, to: S, value: i16) -> Result<()>
    where
        S: Write
;
fn encode_sl<S>(&self, to: S, value: i32) -> Result<()>
    where
        S: Write
;
fn encode_fl<S>(&self, to: S, value: f32) -> Result<()>
    where
        S: Write
;
fn encode_fd<S>(&self, to: S, value: f64) -> Result<()>
    where
        S: Write
; fn with_encoder<T, F1, F2>(&self, f_le: F1, f_be: F2) -> T
    where
        F1: FnOnce(LittleEndianBasicEncoder) -> T,
        F2: FnOnce(BigEndianBasicEncoder) -> T
, { ... } }

Type trait for an encoder of basic data properties. Unlike Encode (and similar to BasicDecode), this trait is not object safe because it's better to just provide a dynamic implementation.

Required methods

fn endianness(&self) -> Endianness

Retrieve the encoder's endianness.

fn encode_us<S>(&self, to: S, value: u16) -> Result<()> where
    S: Write

Encode an unsigned short value to the given writer.

fn encode_ul<S>(&self, to: S, value: u32) -> Result<()> where
    S: Write

Encode an unsigned long value to the given writer.

fn encode_ss<S>(&self, to: S, value: i16) -> Result<()> where
    S: Write

Encode a signed short value to the given writer.

fn encode_sl<S>(&self, to: S, value: i32) -> Result<()> where
    S: Write

Encode a signed long value to the given writer.

fn encode_fl<S>(&self, to: S, value: f32) -> Result<()> where
    S: Write

Encode a single precision float value to the given writer.

fn encode_fd<S>(&self, to: S, value: f64) -> Result<()> where
    S: Write

Encode a double precision float value to the given writer.

Loading content...

Provided methods

fn with_encoder<T, F1, F2>(&self, f_le: F1, f_be: F2) -> T where
    F1: FnOnce(LittleEndianBasicEncoder) -> T,
    F2: FnOnce(BigEndianBasicEncoder) -> T, 

Perform

Loading content...

Implementors

impl BasicEncode for BasicEncoder[src]

impl BasicEncode for BigEndianBasicEncoder[src]

impl BasicEncode for LittleEndianBasicEncoder[src]

impl<W: Write + ?Sized> BasicEncode for ExplicitVRLittleEndianEncoder<W>[src]

impl<W: ?Sized> BasicEncode for ExplicitVRBigEndianEncoder<W>[src]

impl<W: ?Sized> BasicEncode for ImplicitVRLittleEndianEncoder<W> where
    W: Write
[src]

Loading content...