Struct dicom_dump::DumpOptions [−][src]
#[non_exhaustive]pub struct DumpOptions {
pub format: DumpFormat,
pub color: ColorMode,
pub width: Option<u32>,
pub no_text_limit: bool,
}
Expand description
Options and flags to configure how to dump a DICOM file or object.
This is a builder which exposes the various options available for printing the contents of the DICOM file in a readable way.
Once set up,
the dump_file
or dump_file_to
methods can be used
to finalize the DICOM data dumping process on an open file.
Both file meta table and main data set are dumped.
Alternatively,
dump_object
or dump_object_to
methods
work on bare DICOM objects without a file meta table.
Example
use dicom::object::open_file;
use dicom_dump::{ColorMode, DumpOptions};
let my_dicom_file = open_file("/path_to_file")?;
let mut options = DumpOptions::new();
options
// maximum 120 characters per line
.width(120)
// no limit for text values
.no_text_limit(true)
// never print colored output
.color_mode(ColorMode::Never)
// dump to stdout
.dump_file(&my_dicom_file)?;
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.format: DumpFormat
the output format
color: ColorMode
the output color mode
width: Option<u32>
the console width to assume when trimming long values
no_text_limit: bool
never trim out long text values
Implementations
Set the output format.
See the DumpFormat
documentation for the list of supported formats.
Set the maximum output width in number of characters.
Set the maximum output width to automatic, based on terminal size.
This is the default behavior. If a terminal width could not be determined, the default width of 120 characters is used.
Set whether to remove the maximum width restriction for text values.
Set the output color mode.
Dump the contents of an open DICOM file to standard output.
pub fn dump_file_to<D>(
&self,
to: impl Write,
obj: &FileDicomObject<InMemDicomObject<D>>
) -> IoResult<()> where
D: DataDictionary,
pub fn dump_file_to<D>(
&self,
to: impl Write,
obj: &FileDicomObject<InMemDicomObject<D>>
) -> IoResult<()> where
D: DataDictionary,
Dump the contents of an open DICOM file to the given writer.
pub fn dump_object<D>(&self, obj: &InMemDicomObject<D>) -> IoResult<()> where
D: DataDictionary,
pub fn dump_object<D>(&self, obj: &InMemDicomObject<D>) -> IoResult<()> where
D: DataDictionary,
Dump the contents of a DICOM object to standard output.
pub fn dump_object_to<D>(
&self,
to: impl Write,
obj: &InMemDicomObject<D>
) -> IoResult<()> where
D: DataDictionary,
pub fn dump_object_to<D>(
&self,
to: impl Write,
obj: &InMemDicomObject<D>
) -> IoResult<()> where
D: DataDictionary,
Dump the contents of a DICOM object to the given writer.
Trait Implementations
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for DumpOptions
impl Send for DumpOptions
impl Sync for DumpOptions
impl Unpin for DumpOptions
impl UnwindSafe for DumpOptions
Blanket Implementations
Mutably borrows from an owned value. Read more