[−][src]Struct dicom_parser::stateful::encode::StatefulEncoder
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]
to: Box<dyn Write + 's>,
ts: TransferSyntax,
charset: SpecificCharacterSet
) -> Result<Self>
impl<W, E, T> StatefulEncoder<W, E, T> where
W: Write,
E: EncodeTo<W>,
T: TextCodec,
[src]
W: Write,
E: EncodeTo<W>,
T: TextCodec,
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]
&mut self,
de: &DataElementHeader,
value: &PrimitiveValue
) -> Result<()>
Encode and write a primitive value. Where applicable, this will use the inner text codec for textual values.
Trait Implementations
Auto Trait Implementations
impl<W, E, T> RefUnwindSafe for StatefulEncoder<W, E, T> where
E: RefUnwindSafe,
T: RefUnwindSafe,
W: RefUnwindSafe,
E: RefUnwindSafe,
T: RefUnwindSafe,
W: RefUnwindSafe,
impl<W, E, T> Send for StatefulEncoder<W, E, T> where
E: Send,
T: Send,
W: Send,
E: Send,
T: Send,
W: Send,
impl<W, E, T> Sync for StatefulEncoder<W, E, T> where
E: Sync,
T: Sync,
W: Sync,
E: Sync,
T: Sync,
W: Sync,
impl<W, E, T> Unpin for StatefulEncoder<W, E, T> where
E: Unpin,
T: Unpin,
W: Unpin,
E: Unpin,
T: Unpin,
W: Unpin,
impl<W, E, T> UnwindSafe for StatefulEncoder<W, E, T> where
E: UnwindSafe,
T: UnwindSafe,
W: UnwindSafe,
E: UnwindSafe,
T: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,