[][src]Trait dicom_encoding::text::TextCodec

pub trait TextCodec: Debug {
    fn decode(&self, text: &[u8]) -> Result<String>;
fn encode(&self, text: &str) -> Result<Vec<u8>>; }

A holder of encoding and decoding mechanisms for text in DICOM content, which according to the standard, depends on the specific character set.

Required methods

fn decode(&self, text: &[u8]) -> Result<String>

Decode the given byte buffer as a single string. The resulting string may contain backslash characters ('') to delimit individual values, and should be split later on if required.

fn encode(&self, text: &str) -> Result<Vec<u8>>

Encode a text value into a byte vector. The input string can feature multiple text values by using the backslash character ('') as the value delimiter.

Loading content...

Implementations on Foreign Types

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

impl<'a, T: ?Sized> TextCodec for &'a T where
    T: TextCodec
[src]

Loading content...

Implementors

impl TextCodec for DefaultCharacterSetCodec[src]

impl TextCodec for Utf8CharacterSetCodec[src]

Loading content...