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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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.

Dump the contents of an open DICOM file to the given writer.

Dump the contents of a DICOM object to standard output.

Dump the contents of a DICOM object to the given writer.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.