[][src]Struct dicom_parser::stateful::encode::StatefulEncoder

pub struct StatefulEncoder<W, E, T> { /* fields omitted */ }

Also called a printer, this encoder type provides a stateful mid-level abstraction for writing DICOM content. Unlike Encode, the stateful encoder knows how to write text values and keeps track of how many bytes were written. W is the write target, E is the encoder, and T is the text codec.

Implementations

impl<W, E, T> StatefulEncoder<W, E, T>[src]

pub fn new(to: W, encoder: E, text: T) -> Self[src]

pub fn with_text<U>(self, text: U) -> StatefulEncoder<W, E, U>[src]

impl<'s> StatefulEncoder<Box<dyn Write + 'w>, Box<dyn EncodeTo<dyn Write + 'static> + 'w>, Box<dyn TextCodec + 'static>>[src]

pub fn from_transfer_syntax(
    to: Box<dyn Write + 's>,
    ts: TransferSyntax,
    charset: SpecificCharacterSet
) -> Result<Self>
[src]

impl<W, E, T> StatefulEncoder<W, E, T> where
    W: Write,
    E: EncodeTo<W>,
    T: TextCodec
[src]

pub fn encode_element_header(&mut self, de: DataElementHeader) -> Result<()>[src]

Encode and write a data element header.

pub fn encode_item_header(&mut self, len: u32) -> Result<()>[src]

Encode and write an item header.

pub fn encode_item_delimiter(&mut self) -> Result<()>[src]

Encode and write an item delimiter.

pub fn encode_sequence_delimiter(&mut self) -> Result<()>[src]

Encode and write a sequence delimiter.

pub fn write_bytes(&mut self, bytes: &[u8]) -> Result<()>[src]

Write all bytes directly to the inner writer.

pub fn bytes_written(&self) -> u64[src]

Retrieve the number of bytes written so far by this printer.

pub fn encode_primitive(
    &mut self,
    de: &DataElementHeader,
    value: &PrimitiveValue
) -> Result<()>
[src]

Encode and write a primitive value. Where applicable, this will use the inner text codec for textual values.

Trait Implementations

impl<W: Debug, E: Debug, T: Debug> Debug for StatefulEncoder<W, E, T>[src]

Auto Trait Implementations

impl<W, E, T> RefUnwindSafe for StatefulEncoder<W, E, T> where
    E: RefUnwindSafe,
    T: RefUnwindSafe,
    W: RefUnwindSafe

impl<W, E, T> Send for StatefulEncoder<W, E, T> where
    E: Send,
    T: Send,
    W: Send

impl<W, E, T> Sync for StatefulEncoder<W, E, T> where
    E: Sync,
    T: Sync,
    W: Sync

impl<W, E, T> Unpin for StatefulEncoder<W, E, T> where
    E: Unpin,
    T: Unpin,
    W: Unpin

impl<W, E, T> UnwindSafe for StatefulEncoder<W, E, T> where
    E: UnwindSafe,
    T: UnwindSafe,
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.