Enum dicom_core::value::PrimitiveValue

source ·
pub enum PrimitiveValue {
Show 16 variants Empty, Strs(SmallVec<[String; 2]>), Str(String), Tags(SmallVec<[Tag; 2]>), U8(SmallVec<[u8; 2]>), I16(SmallVec<[i16; 2]>), U16(SmallVec<[u16; 2]>), I32(SmallVec<[i32; 2]>), U32(SmallVec<[u32; 2]>), I64(SmallVec<[i64; 2]>), U64(SmallVec<[u64; 2]>), F32(SmallVec<[f32; 2]>), F64(SmallVec<[f64; 2]>), Date(SmallVec<[DicomDate; 2]>), DateTime(SmallVec<[DicomDateTime; 2]>), Time(SmallVec<[DicomTime; 2]>),
}
Expand description

An enum representing a primitive value from a DICOM element. The result of decoding an element’s data value may be one of the enumerated types depending on its content and value representation.

Multiple elements are contained in a smallvec vector, conveniently aliased to the type C.

See the macro dicom_value! for a more intuitive means of constructing these values. Alternatively, From conversions into PrimitiveValue exist for single element types, including numeric types, String, and &str.

§Example

let value = PrimitiveValue::from("Smith^John");
assert_eq!(value, PrimitiveValue::Str("Smith^John".to_string()));
assert_eq!(value.multiplicity(), 1);

let value = PrimitiveValue::from(512_u16);
assert_eq!(value, PrimitiveValue::U16(smallvec![512]));

Variants§

§

Empty

No data. Usually employed for zero-length values.

§

Strs(SmallVec<[String; 2]>)

A sequence of strings. Used for AE, AS, PN, SH, CS, LO, UI and UC. Can also be used for IS, SS, DS, DA, DT and TM when decoding with format preservation.

§

Str(String)

A single string. Used for ST, LT, UT and UR, which are never multi-valued.

§

Tags(SmallVec<[Tag; 2]>)

A sequence of attribute tags. Used specifically for AT.

§

U8(SmallVec<[u8; 2]>)

The value is a sequence of unsigned 8-bit integers. Used for OB and UN.

§

I16(SmallVec<[i16; 2]>)

The value is a sequence of signed 16-bit integers. Used for SS.

§

U16(SmallVec<[u16; 2]>)

A sequence of unsigned 16-bit integers. Used for US and OW.

§

I32(SmallVec<[i32; 2]>)

A sequence of signed 32-bit integers. Used for SL and IS.

§

U32(SmallVec<[u32; 2]>)

A sequence of unsigned 32-bit integers. Used for UL and OL.

§

I64(SmallVec<[i64; 2]>)

A sequence of signed 64-bit integers. Used for SV.

§

U64(SmallVec<[u64; 2]>)

A sequence of unsigned 64-bit integers. Used for UV and OV.

§

F32(SmallVec<[f32; 2]>)

The value is a sequence of 32-bit floating point numbers. Used for OF and FL.

§

F64(SmallVec<[f64; 2]>)

The value is a sequence of 64-bit floating point numbers. Used for OD and FD, DS.

§

Date(SmallVec<[DicomDate; 2]>)

A sequence of dates with arbitrary precision. Used for the DA representation.

§

DateTime(SmallVec<[DicomDateTime; 2]>)

A sequence of date-time values with arbitrary precision. Used for the DT representation.

§

Time(SmallVec<[DicomTime; 2]>)

A sequence of time values with arbitrary precision. Used for the TM representation.

Implementations§

source§

impl PrimitiveValue

source

pub fn new_u16(value: u16) -> Self

Create a single unsigned 16-bit value.

source

pub fn new_u32(value: u32) -> Self

Create a single unsigned 32-bit value.

source

pub fn new_i32(value: i32) -> Self

Create a single I32 value.

source

pub fn multiplicity(&self) -> u32

Obtain the number of individual elements. This number may not match the DICOM value multiplicity in some value representations.

source

pub fn calculate_byte_len(&self) -> usize

Determine the length of the DICOM value in its encoded form.

In other words, this is the number of bytes that the value would need to occupy in a DICOM file, without compression and without the element header. The output is always an even number, so as to consider the mandatory trailing padding.

This method is particularly useful for presenting an estimated space occupation to the end user. However, consumers should not depend on this number for decoding or encoding values. The calculated number does not need to match the length of the original byte stream from where the value was originally decoded.

source

pub fn to_str(&self) -> Cow<'_, str>

Convert the primitive value into a string representation.

String values already encoded with the Str and Strs variants are provided as is. In the case of Strs, the strings are first joined together with a backslash ('\\'). All other type variants are first converted to a string, then joined together with a backslash.

Trailing whitespace is stripped from each string.

Note: As the process of reading a DICOM value may not always preserve its original nature, it is not guaranteed that to_str() returns a string with the exact same byte sequence as the one originally found at the source of the value, even for the string variants. Therefore, this method is not reliable for compliant DICOM serialization.

§Examples
assert_eq!(
    dicom_value!(Str, "Smith^John").to_str(),
    "Smith^John",
);
assert_eq!(
    dicom_value!(Date, DicomDate::from_y(2014)?).to_str(),
    "2014",
);
assert_eq!(
    dicom_value!(Str, "Smith^John\0").to_str(),
    "Smith^John",
);
assert_eq!(
    dicom_value!(Strs, [
        "DERIVED",
        "PRIMARY",
        "WHOLE BODY",
        "EMISSION",
    ])
    .to_str(),
    "DERIVED\\PRIMARY\\WHOLE BODY\\EMISSION",
);
Ok(())
}
source

pub fn to_raw_str(&self) -> Cow<'_, str>

Convert the primitive value into a raw string representation.

String values already encoded with the Str and Strs variants are provided as is. In the case of Strs, the strings are first joined together with a backslash ('\\'). All other type variants are first converted to a string, then joined together with a backslash.

This method keeps all trailing whitespace, unlike to_str().

Note: As the process of reading a DICOM value may not always preserve its original nature, it is not guaranteed that to_raw_str() returns a string with the exact same byte sequence as the one originally found at the source of the value, even for the string variants. Therefore, this method is not reliable for compliant DICOM serialization.

§Examples
assert_eq!(
    dicom_value!(Str, "Smith^John\0").to_raw_str(),
    "Smith^John\0",
);
assert_eq!(
    dicom_value!(Date, DicomDate::from_ymd(2014, 10, 12).unwrap()).to_raw_str(),
    "2014-10-12",
);
assert_eq!(
    dicom_value!(Strs, [
        "DERIVED",
        " PRIMARY ",
        "WHOLE BODY",
        "EMISSION ",
    ])
    .to_raw_str(),
    "DERIVED\\ PRIMARY \\WHOLE BODY\\EMISSION ",
);
source

pub fn to_multi_str(&self) -> Cow<'_, [String]>

Convert the primitive value into a multi-string representation.

String values already encoded with the Str and Strs variants are provided as is. All other type variants are first converted to a string, then collected into a vector.

Trailing whitespace is stripped from each string. If keeping it is desired, use to_raw_str().

Note: As the process of reading a DICOM value may not always preserve its original nature, it is not guaranteed that to_multi_str() returns strings with the exact same byte sequence as the one originally found at the source of the value, even for the string variants. Therefore, this method is not reliable for compliant DICOM serialization.

§Examples
assert_eq!(
    dicom_value!(Strs, [
        "DERIVED",
        "PRIMARY",
        "WHOLE BODY ",
        " EMISSION ",
    ])
    .to_multi_str(),
    &["DERIVED", "PRIMARY", "WHOLE BODY", " EMISSION"][..],
);
assert_eq!(
    dicom_value!(Str, "Smith^John").to_multi_str(),
    &["Smith^John"][..],
);
assert_eq!(
    dicom_value!(Str, "Smith^John\0").to_multi_str(),
    &["Smith^John"][..],
);
assert_eq!(
    dicom_value!(Date, DicomDate::from_ym(2014, 10)?).to_multi_str(),
    &["201410"][..],
);
assert_eq!(
    dicom_value!(I64, [128, 256, 512]).to_multi_str(),
    &["128", "256", "512"][..],
);
Ok(())
}
source

pub fn to_bytes(&self) -> Cow<'_, [u8]>

Retrieve this DICOM value as raw bytes.

Binary numeric values are returned with a reinterpretation of the holding vector’s occupied data block as bytes, without copying, under the platform’s native byte order.

String values already encoded with the Str and Strs variants are provided as their respective bytes in UTF-8. In the case of Strs, the strings are first joined together with a backslash ('\\'). Other type variants are first converted to a string, joined together with a backslash, then turned into a byte vector. For values which are inherently textual according the standard, this is equivalent to calling as_bytes() after to_str().

Note: As the process of reading a DICOM value may not always preserve its original nature, it is not guaranteed that to_bytes() returns the same byte sequence as the one originally found at the source of the value. Therefore, this method is not reliable for compliant DICOM serialization.

§Examples

U8 provides a straight, zero-copy slice of bytes.


assert_eq!(
    PrimitiveValue::U8(smallvec![
        1, 2, 5,
    ]).to_bytes(),
    &[1, 2, 5][..],
);

Other values are converted to text first.

assert_eq!(
    PrimitiveValue::from("Smith^John").to_bytes(),
    &b"Smith^John"[..],
);
assert_eq!(
    PrimitiveValue::from(DicomDate::from_ymd(2014, 10, 12)?)
    .to_bytes(),
    &b"2014-10-12"[..],
);
assert_eq!(
    dicom_value!(Strs, [
        "DERIVED",
        "PRIMARY",
        "WHOLE BODY",
        "EMISSION",
    ])
    .to_bytes(),
    &b"DERIVED\\PRIMARY\\WHOLE BODY\\EMISSION"[..],
);
Ok(())
}
source

pub fn to_int<T>(&self) -> Result<T, ConvertValueError>
where T: NumCast + FromStr<Err = ParseIntError>,

Retrieve a single integer of type T from this value.

If the value is already represented as an integer, it is returned after a conversion to the target type. An error is returned if the integer cannot be represented by the given integer type. If the value is a string or sequence of strings, the first string is parsed to obtain an integer, potentially failing if the string does not represent a valid integer. The string is stripped of leading/trailing whitespace before parsing. If the value is a sequence of U8 bytes, the bytes are individually interpreted as independent numbers. Otherwise, the operation fails.

Note that this method does not enable the conversion of floating point numbers to integers via truncation. If this is intentional, retrieve a float via to_float32 or to_float64 instead, then cast it to an integer.

§Example

assert_eq!(
    PrimitiveValue::I32(smallvec![
        1, 2, 5,
    ])
    .to_int::<u32>().ok(),
    Some(1_u32),
);

assert_eq!(
    PrimitiveValue::from("505 ").to_int::<i32>().ok(),
    Some(505),
);
source

pub fn to_multi_int<T>(&self) -> Result<Vec<T>, ConvertValueError>
where T: NumCast + FromStr<Err = ParseIntError>,

Retrieve a sequence of integers of type T from this value.

If the values is already represented as an integer, it is returned after a NumCast conversion to the target type. An error is returned if any of the integers cannot be represented by the given integer type. If the value is a string or sequence of strings, each string is parsed to obtain an integer, potentially failing if the string does not represent a valid integer. The string is stripped of leading/trailing whitespace before parsing. If the value is a sequence of U8 bytes, the bytes are individually interpreted as independent numbers. Otherwise, the operation fails.

Note that this method does not enable the conversion of floating point numbers to integers via truncation. If this is intentional, retrieve a float via to_float32 or to_float64 instead, then cast it to an integer.

§Example

assert_eq!(
    PrimitiveValue::I32(smallvec![
        1, 2, 5,
    ])
    .to_multi_int::<u32>().ok(),
    Some(vec![1_u32, 2, 5]),
);

assert_eq!(
    dicom_value!(Strs, ["5050", "23 "]).to_multi_int::<i32>().ok(),
    Some(vec![5050, 23]),
);
source

pub fn to_float32(&self) -> Result<f32, ConvertValueError>

Retrieve one single-precision floating point from this value.

If the value is already represented as a number, it is returned after a conversion to f32. An error is returned if the number cannot be represented by the given number type. If the value is a string or sequence of strings, the first string is parsed to obtain a number, potentially failing if the string does not represent a valid number. The string is stripped of leading/trailing whitespace before parsing. If the value is a sequence of U8 bytes, the bytes are individually interpreted as independent numbers. Otherwise, the operation fails.

§Example

assert_eq!(
    PrimitiveValue::F32(smallvec![
        1.5, 2., 5.,
    ])
    .to_float32().ok(),
    Some(1.5_f32),
);

assert_eq!(
    PrimitiveValue::from("-6.75 ").to_float32().ok(),
    Some(-6.75),
);
source

pub fn to_multi_float32(&self) -> Result<Vec<f32>, ConvertValueError>

Retrieve a sequence of single-precision floating point numbers from this value.

If the value is already represented as numbers, they are returned after a conversion to f32. An error is returned if any of the numbers cannot be represented by an f32. If the value is a string or sequence of strings, the strings are parsed to obtain a number, potentially failing if the string does not represent a valid number. The string is stripped of leading/trailing whitespace before parsing. If the value is a sequence of U8 bytes, the bytes are individually interpreted as independent numbers. Otherwise, the operation fails.

§Example

assert_eq!(
    PrimitiveValue::F32(smallvec![
        1.5, 2., 5.,
    ])
    .to_multi_float32().ok(),
    Some(vec![1.5_f32, 2., 5.]),
);

assert_eq!(
    PrimitiveValue::from("-6.75 ").to_multi_float32().ok(),
    Some(vec![-6.75]),
);
source

pub fn to_float64(&self) -> Result<f64, ConvertValueError>

Retrieve one double-precision floating point from this value.

If the value is already represented as a number, it is returned after a conversion to f64. An error is returned if the number cannot be represented by the given number type. If the value is a string or sequence of strings, the first string is parsed to obtain a number, potentially failing if the string does not represent a valid number. The string is stripped of leading/trailing whitespace before parsing. If the value is a sequence of U8 bytes, the bytes are individually interpreted as independent numbers. Otherwise, the operation fails.

§Example

assert_eq!(
    PrimitiveValue::F64(smallvec![
        1.5, 2., 5.,
    ])
    .to_float64().ok(),
    Some(1.5_f64),
);

assert_eq!(
    PrimitiveValue::from("-6.75 ").to_float64().ok(),
    Some(-6.75),
);
source

pub fn to_multi_float64(&self) -> Result<Vec<f64>, ConvertValueError>

Retrieve a sequence of double-precision floating point numbers from this value.

If the value is already represented as numbers, they are returned after a conversion to f64. An error is returned if any of the numbers cannot be represented by an f64. If the value is a string or sequence of strings, the strings are parsed to obtain a number, potentially failing if the string does not represent a valid number. The string is stripped of leading/trailing whitespace before parsing. If the value is a sequence of U8 bytes, the bytes are individually interpreted as independent numbers. Otherwise, the operation fails.

§Example

assert_eq!(
    PrimitiveValue::F64(smallvec![
        1.5, 2., 5.,
    ])
    .to_multi_float64().ok(),
    Some(vec![1.5_f64, 2., 5.]),
);

assert_eq!(
    PrimitiveValue::from("-6.75 ").to_multi_float64().ok(),
    Some(vec![-6.75]),
);
source

pub fn to_naive_date(&self) -> Result<NaiveDate, ConvertValueError>

Retrieve a single chrono::NaiveDate from this value.

Please note, that this is a shortcut to obtain a usable date from a primitive value. As per standard, the stored value might not be precise. It is highly recommended to use .to_date() as the only way to obtain dates.

If the value is already represented as a precise DicomDate, it is converted to a NaiveDate value. It fails for imprecise values. If the value is a string or sequence of strings, the first string is decoded to obtain a date, potentially failing if the string does not represent a valid date. If the value is a sequence of U8 bytes, the bytes are first interpreted as an ASCII character string.

Users are advised that this method is DICOM compliant and a full date representation of YYYYMMDD is required. Otherwise, the operation fails.

Partial precision dates are handled by DicomDate, which can be retrieved by .to_date().

§Example

assert_eq!(
    PrimitiveValue::Date(smallvec![
        DicomDate::from_ymd(2014, 10, 12)?,
    ])
    .to_naive_date().ok(),
    Some(NaiveDate::from_ymd(2014, 10, 12)),
);

assert_eq!(
    PrimitiveValue::Strs(smallvec![
        "20141012".to_string(),
    ])
    .to_naive_date().ok(),
    Some(NaiveDate::from_ymd(2014, 10, 12)),
);

assert!(
    PrimitiveValue::Str("201410".to_string())
    .to_naive_date().is_err()
);
source

pub fn to_multi_naive_date(&self) -> Result<Vec<NaiveDate>, ConvertValueError>

Retrieve the full sequence of chrono::NaiveDates from this value.

Please note, that this is a shortcut to obtain usable dates from a primitive value. As per standard, the stored values might not be precise. It is highly recommended to use .to_multi_date() as the only way to obtain dates.

If the value is already represented as a sequence of precise DicomDate values, it is converted. It fails for imprecise values. If the value is a string or sequence of strings, the strings are decoded to obtain a date, potentially failing if any of the strings does not represent a valid date. If the value is a sequence of U8 bytes, the bytes are first interpreted as an ASCII character string, then as a backslash-separated list of dates.

Users are advised that this method is DICOM compliant and a full date representation of YYYYMMDD is required. Otherwise, the operation fails.

Partial precision dates are handled by DicomDate, which can be retrieved by .to_multi_date().

§Example

assert_eq!(
    PrimitiveValue::Date(smallvec![
        DicomDate::from_ymd(2014, 10, 12)?,
    ]).to_multi_naive_date().ok(),
    Some(vec![NaiveDate::from_ymd(2014, 10, 12)]),
);

assert_eq!(
    PrimitiveValue::Strs(smallvec![
        "20141012".to_string(),
        "20200828".to_string(),
    ]).to_multi_naive_date().ok(),
    Some(vec![
        NaiveDate::from_ymd(2014, 10, 12),
        NaiveDate::from_ymd(2020, 8, 28),
    ]),
);
source

pub fn to_date(&self) -> Result<DicomDate, ConvertValueError>

Retrieve a single DicomDate from this value.

If the value is already represented as a DicomDate, it is returned. If the value is a string or sequence of strings, the first string is decoded to obtain a DicomDate, potentially failing if the string does not represent a valid DicomDate. If the value is a sequence of U8 bytes, the bytes are first interpreted as an ASCII character string.

Unlike Rust’s chrono::NaiveDate, DicomDate allows for missing date components. DicomDate implements AsRange trait, so specific chrono::NaiveDate values can be retrieved.

§Example
use dicom_core::value::{AsRange, DicomDate};

 let value = PrimitiveValue::Str("200002".into());
 let date = value.to_date()?;

 // it is not precise, day of month is unspecified
 assert_eq!(
    date.is_precise(),
    false
    );
 assert_eq!(
    date.earliest()?,
    NaiveDate::from_ymd(2000,2,1)
    );
 assert_eq!(
    date.latest()?,
    NaiveDate::from_ymd(2000,2,29)
    );
 assert!(date.exact().is_err());

 let date = PrimitiveValue::Str("20000201".into()).to_date()?;
 assert_eq!(
    date.is_precise(),
    true
    );
 // .to_naive_date() works only for precise values
 assert_eq!(
    date.exact()?,
    date.to_naive_date()?
 );
source

pub fn to_multi_date(&self) -> Result<Vec<DicomDate>, ConvertValueError>

Retrieve the full sequence of DicomDates from this value.

§Example
use dicom_core::value::DicomDate;

assert_eq!(
    dicom_value!(Strs, ["201410", "2020", "20200101"])
        .to_multi_date()?,
    vec![
        DicomDate::from_ym(2014, 10)?,
        DicomDate::from_y(2020)?,
        DicomDate::from_ymd(2020, 1, 1)?
    ]);
source

pub fn to_naive_time(&self) -> Result<NaiveTime, ConvertValueError>

Retrieve a single chrono::NaiveTime from this value.

Please note, that this is a shortcut to obtain a usable time from a primitive value. As per standard, the stored value might not be precise. It is highly recommended to use .to_time() as the only way to obtain times.

If the value is represented as a precise DicomTime, it is converted to a NaiveTime. It fails for imprecise values, as in, those which do not specify up to at least the seconds. If the value is a string or sequence of strings, the first string is decoded to obtain a time, potentially failing if the string does not represent a valid time. If the value is a sequence of U8 bytes, the bytes are first interpreted as an ASCII character string. Otherwise, the operation fails.

Partial precision times are handled by DicomTime, which can be retrieved by .to_time().

§Example

assert_eq!(
    PrimitiveValue::from(DicomTime::from_hms(11, 2, 45)?).to_naive_time().ok(),
    Some(NaiveTime::from_hms(11, 2, 45)),
);

assert_eq!(
    PrimitiveValue::from("110245.78").to_naive_time().ok(),
    Some(NaiveTime::from_hms_milli(11, 2, 45, 780)),
);
source

pub fn to_multi_naive_time(&self) -> Result<Vec<NaiveTime>, ConvertValueError>

Retrieve the full sequence of chrono::NaiveTimes from this value.

Please note, that this is a shortcut to obtain a usable time from a primitive value. As per standard, the stored values might not be precise. It is highly recommended to use .to_multi_time() as the only way to obtain times.

If the value is already represented as a sequence of precise DicomTime values, it is converted to a sequence of NaiveTime values. It fails for imprecise values. If the value is a string or sequence of strings, the strings are decoded to obtain a date, potentially failing if any of the strings does not represent a valid date. If the value is a sequence of U8 bytes, the bytes are first interpreted as an ASCII character string, then as a backslash-separated list of times. Otherwise, the operation fails.

Users are advised that this method requires at least 1 out of 6 digits of the second fraction .F to be present. Otherwise, the operation fails.

Partial precision times are handled by DicomTime, which can be retrieved by .to_multi_time().

§Example

assert_eq!(
    PrimitiveValue::from(DicomTime::from_hms(22, 58, 2)?).to_multi_naive_time().ok(),
    Some(vec![NaiveTime::from_hms(22, 58, 2)]),
);

assert_eq!(
    PrimitiveValue::Strs(smallvec![
        "225802.1".to_string(),
        "225916.742388".to_string(),
    ]).to_multi_naive_time().ok(),
    Some(vec![
        NaiveTime::from_hms_micro(22, 58, 2, 100_000),
        NaiveTime::from_hms_micro(22, 59, 16, 742_388),
    ]),
);
source

pub fn to_time(&self) -> Result<DicomTime, ConvertValueError>

Retrieve a single DicomTime from this value.

If the value is already represented as a time, it is converted into DicomTime. If the value is a string or sequence of strings, the first string is decoded to obtain a DicomTime, potentially failing if the string does not represent a valid DicomTime. If the value is a sequence of U8 bytes, the bytes are first interpreted as an ASCII character string.

Unlike Rust’s chrono::NaiveTime, DicomTime allows for missing time components. DicomTime implements AsRange trait, so specific chrono::NaiveTime values can be retrieved.

§Example
use dicom_core::value::{AsRange, DicomTime};

 let value = PrimitiveValue::Str("10".into());
 let time = value.to_time()?;

 // is not precise, minute, second and second fraction are unspecified
 assert_eq!(
    time.is_precise(),
    false
    );
 assert_eq!(
    time.earliest()?,
    NaiveTime::from_hms(10,0,0)
    );
 assert_eq!(
    time.latest()?,
    NaiveTime::from_hms_micro(10,59,59,999_999)
    );
 assert!(time.exact().is_err());

 let second = PrimitiveValue::Str("101259".into());
 // not a precise value, fraction of second is unspecified
 assert!(second.to_time()?.exact().is_err());

 // .to_naive_time() yields a result, for at least second precision values
 // second fraction defaults to zeros
 assert_eq!(
    second.to_time()?.to_naive_time()?,
    NaiveTime::from_hms(10,12,59)
 );

 let fraction6 = PrimitiveValue::Str("101259.123456".into());
 let fraction5 = PrimitiveValue::Str("101259.12345".into());
  
 // is not precise, last digit of second fraction is unspecified
 assert!(
    fraction5.to_time()?.exact().is_err()
 );
 assert!(
    fraction6.to_time()?.exact().is_ok()
 );
  
 assert_eq!(
    fraction6.to_time()?.exact()?,
    fraction6.to_time()?.to_naive_time()?
 );
source

pub fn to_multi_time(&self) -> Result<Vec<DicomTime>, ConvertValueError>

Retrieve the full sequence of DicomTimes from this value.

If the value is already represented as a time, it is converted into DicomTime. If the value is a string or sequence of strings, the first string is decoded to obtain a DicomTime, potentially failing if the string does not represent a valid DicomTime. If the value is a sequence of U8 bytes, the bytes are first interpreted as an ASCII character string.

Unlike Rust’s chrono::NaiveTime, DicomTime allows for missing time components. DicomTime implements AsRange trait, so specific chrono::NaiveTime values can be retrieved.

§Example
use dicom_core::value::DicomTime;

assert_eq!(
    PrimitiveValue::Strs(smallvec![
        "2258".to_string(),
        "225916.000742".to_string(),
    ]).to_multi_time()?,
    vec![
        DicomTime::from_hm(22, 58)?,
        DicomTime::from_hms_micro(22, 59, 16, 742)?,
    ],
);
source

pub fn to_chrono_datetime(&self)

👎Deprecated since 0.7.0: Use to_datetime instead
source

pub fn to_multi_chrono_datetime(&self)

👎Deprecated since 0.7.0: Use to_multi_datetime instead
source

pub fn to_datetime(&self) -> Result<DicomDateTime, ConvertValueError>

Retrieve a single DicomDateTime from this value.

If the value is already represented as a date-time, it is converted into DicomDateTime. If the value is a string or sequence of strings, the first string is decoded to obtain a DicomDateTime, potentially failing if the string does not represent a valid DicomDateTime. If the value is a sequence of U8 bytes, the bytes are first interpreted as an ASCII character string.

Unlike Rust’s chrono::DateTime, DicomDateTime allows for missing date or time components. DicomDateTime implements AsRange trait, so specific chrono::DateTime values can be retrieved.

§Example
use dicom_core::value::{DicomDateTime, AsRange, DateTimeRange, PreciseDateTime};


// let's parse a date-time text value with 0.1 second precision without a time-zone.
let dt_value = PrimitiveValue::from("20121221093001.1").to_datetime()?;

assert_eq!(
    dt_value.earliest()?,
    PreciseDateTime::Naive(NaiveDateTime::new(
     NaiveDate::from_ymd_opt(2012, 12, 21).unwrap(),
     NaiveTime::from_hms_micro_opt(9, 30, 1, 100_000).unwrap()
        ))
);
assert_eq!(
    dt_value.latest()?,
    PreciseDateTime::Naive(NaiveDateTime::new(
     NaiveDate::from_ymd_opt(2012, 12, 21).unwrap(),
     NaiveTime::from_hms_micro_opt(9, 30, 1, 199_999).unwrap()
        ))
);

let default_offset = FixedOffset::east_opt(3600).unwrap();
// let's parse a date-time text value with full precision with a time-zone east +01:00.
let dt_value = PrimitiveValue::from("20121221093001.123456+0100").to_datetime()?;

// date-time has all components
assert_eq!(dt_value.is_precise(), true);

assert_eq!(
    dt_value.exact()?,
    PreciseDateTime::TimeZone(
    default_offset
    .ymd_opt(2012, 12, 21).unwrap()
    .and_hms_micro_opt(9, 30, 1, 123_456).unwrap()
    )
        
);

// ranges are inclusive, for a precise value, two identical values are returned
assert_eq!(
    dt_value.range()?,
    DateTimeRange::from_start_to_end_with_time_zone(
        FixedOffset::east_opt(3600).unwrap()
            .ymd_opt(2012, 12, 21).unwrap()
            .and_hms_micro_opt(9, 30, 1, 123_456).unwrap(),
        FixedOffset::east_opt(3600).unwrap()
            .ymd_opt(2012, 12, 21).unwrap()
            .and_hms_micro_opt(9, 30, 1, 123_456).unwrap()
    )?
     
);
source

pub fn to_multi_datetime(&self) -> Result<Vec<DicomDateTime>, ConvertValueError>

Retrieve the full sequence of DicomDateTimes from this value.

source

pub fn to_date_range(&self) -> Result<DateRange, ConvertValueError>

Retrieve a single DateRange from this value.

If the value is already represented as a DicomDate, it is converted into DateRange. If the value is a string or sequence of strings, the first string is decoded to obtain a DateRange, potentially failing if the string does not represent a valid DateRange. If the value is a sequence of U8 bytes, the bytes are first interpreted as an ASCII character string.

§Example
use chrono::{NaiveDate};
use dicom_core::value::{DateRange};


let da_range = PrimitiveValue::from("2012-201305").to_date_range()?;

assert_eq!(
    da_range.start(),
    Some(&NaiveDate::from_ymd(2012, 1, 1))
);
assert_eq!(
    da_range.end(),
    Some(&NaiveDate::from_ymd(2013, 05, 31))
);

let range_from = PrimitiveValue::from("2012-").to_date_range()?;

assert!(range_from.end().is_none());
source

pub fn to_time_range(&self) -> Result<TimeRange, ConvertValueError>

Retrieve a single TimeRange from this value.

If the value is already represented as a DicomTime, it is converted into a TimeRange. If the value is a string or sequence of strings, the first string is decoded to obtain a TimeRange, potentially failing if the string does not represent a valid DateRange. If the value is a sequence of U8 bytes, the bytes are first interpreted as an ASCII character string.

§Example
use chrono::{NaiveTime};
use dicom_core::value::{TimeRange};


let tm_range = PrimitiveValue::from("02-153000.123").to_time_range()?;

// null components default to zeros
assert_eq!(
    tm_range.start(),
    Some(&NaiveTime::from_hms(2, 0, 0))
);

// unspecified part of second fraction defaults to latest possible
assert_eq!(
    tm_range.end(),
    Some(&NaiveTime::from_hms_micro(15, 30, 0, 123_999))
);

let range_from = PrimitiveValue::from("01-").to_time_range()?;

assert!(range_from.end().is_none());
source

pub fn to_datetime_range(&self) -> Result<DateTimeRange, ConvertValueError>

Retrieve a single DateTimeRange from this value.

If the value is already represented as a DicomDateTime, it is converted into DateTimeRange. If the value is a string or sequence of strings, the first string is decoded to obtain a DateTimeRange, potentially failing if the string does not represent a valid DateTimeRange. If the value is a sequence of U8 bytes, the bytes are first interpreted as an ASCII character string.

§Example
use chrono::{DateTime, NaiveDate, NaiveTime, NaiveDateTime, FixedOffset, TimeZone, Local};
use dicom_core::value::{DateTimeRange, PreciseDateTime};


// let's parse a text representation of a date-time range, where the lower bound is a microsecond
// precision value with a time-zone (east +05:00) and the upper bound is a minimum precision value
// with a time-zone
let dt_range = PrimitiveValue::from("19920101153020.123+0500-1993+0300").to_datetime_range()?;

// lower bound of range is parsed into a PreciseDateTimeResult::TimeZone variant
assert_eq!(
    dt_range.start(),
    Some(PreciseDateTime::TimeZone(
        FixedOffset::east_opt(5*3600).unwrap().ymd_opt(1992, 1, 1).unwrap()
        .and_hms_micro_opt(15, 30, 20, 123_000).unwrap()
        )  
    )
);

// upper bound of range is parsed into a PreciseDateTimeResult::TimeZone variant
assert_eq!(
    dt_range.end(),
    Some(PreciseDateTime::TimeZone(
        FixedOffset::east_opt(3*3600).unwrap().ymd_opt(1993, 12, 31).unwrap()
        .and_hms_micro_opt(23, 59, 59, 999_999).unwrap()
        )  
    )
);

let lower = PrimitiveValue::from("2012-").to_datetime_range()?;

// range has no upper bound
assert!(lower.end().is_none());

// One time-zone in a range is missing
let dt_range = PrimitiveValue::from("1992+0500-1993").to_datetime_range()?;

// It will be replaced with the local clock time-zone offset
// This can be customized with [to_datetime_range_custom()]
assert_eq!(
  dt_range,
  DateTimeRange::TimeZone{
        start: Some(FixedOffset::east_opt(5*3600).unwrap()
            .ymd_opt(1992, 1, 1).unwrap()
            .and_hms_micro_opt(0, 0, 0, 0).unwrap()
        ),
        end: Some(Local::now().offset()
            .ymd_opt(1993, 12, 31).unwrap()
            .and_hms_micro_opt(23, 59, 59, 999_999).unwrap()
        )
    }
);
source

pub fn to_datetime_range_custom<T: AmbiguousDtRangeParser>( &self ) -> Result<DateTimeRange, ConvertValueError>

Retrieve a single DateTimeRange from this value.

Use a custom ambiguous date-time range parser.

For full description see PrimitiveValue::to_datetime_range and AmbiguousDtRangeParser.

§Example
use dicom_core::value::range::{AmbiguousDtRangeParser, ToKnownTimeZone, IgnoreTimeZone, FailOnAmbiguousRange, DateTimeRange};
use chrono::{NaiveDate, NaiveTime, NaiveDateTime};

// The upper bound time-zone is missing
// the default behavior in this case is to use the local clock time-zone.
// But we want to use the known (parsed) time-zone from the lower bound instead.
let dt_range = PrimitiveValue::from("1992+0500-1993")
    .to_datetime_range_custom::<ToKnownTimeZone>()?;

// values are in the same time-zone
assert_eq!(
    dt_range.start().unwrap()
        .as_datetime().unwrap()
        .offset(),
    dt_range.end().unwrap()
        .as_datetime().unwrap()
        .offset()
);

// ignore parsed time-zone, retrieve a time-zone naive range
let naive_range = PrimitiveValue::from("1992+0599-1993")
    .to_datetime_range_custom::<IgnoreTimeZone>()?;

assert_eq!(
    naive_range,
    DateTimeRange::from_start_to_end(
        NaiveDateTime::new(
            NaiveDate::from_ymd_opt(1992, 1, 1).unwrap(),
            NaiveTime::from_hms_micro_opt(0, 0, 0, 0).unwrap()
        ),
        NaiveDateTime::new(
            NaiveDate::from_ymd_opt(1993, 12, 31).unwrap(),
            NaiveTime::from_hms_micro_opt(23, 59, 59, 999_999).unwrap()
        )
    ).unwrap()
);

// always fail upon parsing an ambiguous DT range
assert!(
PrimitiveValue::from("1992+0599-1993")
    .to_datetime_range_custom::<FailOnAmbiguousRange>().is_err()
);


source

pub fn to_person_name(&self) -> Result<PersonName<'_>, ConvertValueError>

Retrieve a single PersonName from this value.

If the value is a string or sequence of strings, the first string is split to obtain a PersonName.

§Example
use dicom_core::value::PersonName;

let value = PrimitiveValue::from("Tooms^Victor^Eugene");
// PersonName contains borrowed values
let pn = value.to_person_name()?;

assert_eq!(pn.given(), Some("Victor"));
assert_eq!(pn.middle(), Some("Eugene"));
assert!(pn.prefix().is_none());

let value2 = PrimitiveValue::from(pn);

assert_eq!(value, value2);
source§

impl PrimitiveValue

Per variant, strongly checked getters to DICOM values.

Conversions from one representation to another do not take place when using these methods.

source

pub fn string(&self) -> Result<&str, CastValueError>

Get a single string value.

If it contains multiple strings, only the first one is returned.

An error is returned if the variant is not compatible.

To enable conversions of other variants to a textual representation, see to_str() instead.

source

pub fn strings(&self) -> Result<&[String], CastValueError>

Get the inner sequence of string values if the variant is either Str or Strs.

An error is returned if the variant is not compatible.

To enable conversions of other variants to a textual representation, see to_str() instead.

source

pub fn tag(&self) -> Result<Tag, CastValueError>

Get a single value of the requested type. If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.

source

pub fn tags(&self) -> Result<&[Tag], CastValueError>

Get a sequence of values of the requested type without copying. An error is returned if the variant is not compatible.

source

pub fn date(&self) -> Result<DicomDate, CastValueError>

Get a single value of the requested type. If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.

source

pub fn dates(&self) -> Result<&[DicomDate], CastValueError>

Get a sequence of values of the requested type without copying. An error is returned if the variant is not compatible.

source

pub fn time(&self) -> Result<DicomTime, CastValueError>

Get a single value of the requested type. If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.

source

pub fn times(&self) -> Result<&[DicomTime], CastValueError>

Get a sequence of values of the requested type without copying. An error is returned if the variant is not compatible.

source

pub fn datetime(&self) -> Result<DicomDateTime, CastValueError>

Get a single value of the requested type. If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.

source

pub fn datetimes(&self) -> Result<&[DicomDateTime], CastValueError>

Get a sequence of values of the requested type without copying. An error is returned if the variant is not compatible.

source

pub fn uint8(&self) -> Result<u8, CastValueError>

Get a single value of the requested type. If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.

source

pub fn uint8_slice(&self) -> Result<&[u8], CastValueError>

Get a sequence of values of the requested type without copying. An error is returned if the variant is not compatible.

source

pub fn uint16(&self) -> Result<u16, CastValueError>

Get a single value of the requested type. If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.

source

pub fn uint16_slice(&self) -> Result<&[u16], CastValueError>

Get a sequence of values of the requested type without copying. An error is returned if the variant is not compatible.

source

pub fn int16(&self) -> Result<i16, CastValueError>

Get a single value of the requested type. If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.

source

pub fn int16_slice(&self) -> Result<&[i16], CastValueError>

Get a sequence of values of the requested type without copying. An error is returned if the variant is not compatible.

source

pub fn uint32(&self) -> Result<u32, CastValueError>

Get a single value of the requested type. If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.

source

pub fn uint32_slice(&self) -> Result<&[u32], CastValueError>

Get a sequence of values of the requested type without copying. An error is returned if the variant is not compatible.

source

pub fn int32(&self) -> Result<i32, CastValueError>

Get a single value of the requested type. If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.

source

pub fn int32_slice(&self) -> Result<&[i32], CastValueError>

Get a sequence of values of the requested type without copying. An error is returned if the variant is not compatible.

source

pub fn int64(&self) -> Result<i64, CastValueError>

Get a single value of the requested type. If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.

source

pub fn int64_slice(&self) -> Result<&[i64], CastValueError>

Get a sequence of values of the requested type without copying. An error is returned if the variant is not compatible.

source

pub fn uint64(&self) -> Result<u64, CastValueError>

Get a single value of the requested type. If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.

source

pub fn uint64_slice(&self) -> Result<&[u64], CastValueError>

Get a sequence of values of the requested type without copying. An error is returned if the variant is not compatible.

source

pub fn float32(&self) -> Result<f32, CastValueError>

Get a single value of the requested type. If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.

source

pub fn float32_slice(&self) -> Result<&[f32], CastValueError>

Get a sequence of values of the requested type without copying. An error is returned if the variant is not compatible.

source

pub fn float64(&self) -> Result<f64, CastValueError>

Get a single value of the requested type. If it contains multiple values, only the first one is returned. An error is returned if the variant is not compatible.

source

pub fn float64_slice(&self) -> Result<&[f64], CastValueError>

Get a sequence of values of the requested type without copying. An error is returned if the variant is not compatible.

source

pub fn extend_str<T>( &mut self, strings: impl IntoIterator<Item = T> ) -> Result<(), ModifyValueError>
where T: Into<String>,

Extend a textual value by appending more strings to an existing text or empty value.

An error is returned if the current value is not textual.

§Example
use dicom_core::dicom_value;

let mut value = dicom_value!(Strs, ["Hello"]);
value.extend_str(["DICOM"])?;
assert_eq!(value.to_string(), "Hello\\DICOM");
source

pub fn extend_u16( &mut self, numbers: impl IntoIterator<Item = u16> ) -> Result<(), ModifyValueError>

Extend a value of numbers by appending 16-bit unsigned integers to an existing value.

The value may be empty or already contain numeric or textual values.

If the current value is textual, the numbers provided are converted to text. For the case of numeric values, the given numbers are converted to the current number type through casting, meaning that loss of precision may occur. If this is undesirable, read the current value and replace it manually.

An error is returned if the current value is not compatible with the insertion of integers, such as Tag or Date.

§Example
use dicom_core::dicom_value;

let mut value = dicom_value!(U16, [1, 2]);
value.extend_u16([5])?;
assert_eq!(value.to_multi_int::<u16>()?, vec![1, 2, 5]);

let mut value = dicom_value!(Strs, ["City"]);
value.extend_u16([17])?;
assert_eq!(value.to_string(), "City\\17");
source

pub fn extend_i16( &mut self, numbers: impl IntoIterator<Item = i16> ) -> Result<(), ModifyValueError>

Extend a value of numbers by appending 16-bit signed integers to an existing value.

The value may be empty or already contain numeric or textual values.

If the current value is textual, the numbers provided are converted to text. For the case of numeric values, the given numbers are converted to the current number type through casting, meaning that loss of precision may occur. If this is undesirable, read the current value and replace it manually.

An error is returned if the current value is not compatible with the insertion of integers, such as Tag or Date.

§Example
use dicom_core::dicom_value;

let mut value = dicom_value!(I16, [1, 2]);
value.extend_i16([-5])?;
assert_eq!(value.to_multi_int::<i16>()?, vec![1, 2, -5]);

let mut value = dicom_value!(Strs, ["City"]);
value.extend_i16([17])?;
assert_eq!(value.to_string(), "City\\17");
source

pub fn extend_i32( &mut self, numbers: impl IntoIterator<Item = i32> ) -> Result<(), ModifyValueError>

Extend a value of numbers by appending 32-bit signed integers to an existing value.

The value may be empty or already contain numeric or textual values.

If the current value is textual, the numbers provided are converted to text. For the case of numeric values, the given numbers are converted to the current number type through casting, meaning that loss of precision may occur. If this is undesirable, read the current value and replace it manually.

An error is returned if the current value is not compatible with the insertion of integers, such as Tag or Date.

§Example
use dicom_core::dicom_value;

let mut value = dicom_value!(I32, [1, 2]);
value.extend_i32([5])?;
assert_eq!(value.to_multi_int::<i32>()?, vec![1, 2, 5]);

let mut value = dicom_value!(Strs, ["City"]);
value.extend_i32([17])?;
assert_eq!(value.to_string(), "City\\17");
source

pub fn extend_u32( &mut self, numbers: impl IntoIterator<Item = u32> ) -> Result<(), ModifyValueError>

Extend a value of numbers by appending 32-bit unsigned integers to an existing value.

The value may be empty or already contain numeric or textual values.

If the current value is textual, the numbers provided are converted to text. For the case of numeric values, the given numbers are converted to the current number type through casting, meaning that loss of precision may occur. If this is undesirable, read the current value and replace it manually.

An error is returned if the current value is not compatible with the insertion of integers, such as Tag or Date.

§Example
use dicom_core::dicom_value;

let mut value = dicom_value!(U32, [1, 2]);
value.extend_u32([5])?;
assert_eq!(value.to_multi_int::<u32>()?, vec![1, 2, 5]);

let mut value = dicom_value!(Strs, ["City"]);
value.extend_u32([17])?;
assert_eq!(value.to_string(), "City\\17");
source

pub fn extend_f32( &mut self, numbers: impl IntoIterator<Item = f32> ) -> Result<(), ModifyValueError>

Extend a value of numbers by appending 32-bit floating point numbers to an existing value.

The value may be empty or already contain numeric or textual values.

If the current value is textual, the numbers provided are converted to text. For the case of numeric values, the given numbers are converted to the current number type through casting, meaning that loss of precision may occur. If this is undesirable, read the current value and replace it manually.

An error is returned if the current value is not compatible with the insertion of integers, such as Tag or Date.

§Example
use dicom_core::dicom_value;

let mut value = dicom_value!(F32, [1., 2.]);
value.extend_f32([5.])?;
assert_eq!(value.to_multi_float32()?, vec![1., 2., 5.]);

let mut value = dicom_value!(Strs, ["1.25"]);
value.extend_f32([0.5])?;
assert_eq!(value.to_string(), "1.25\\0.5");
source

pub fn extend_f64( &mut self, numbers: impl IntoIterator<Item = f64> ) -> Result<(), ModifyValueError>

Extend a value of numbers by appending 64-bit floating point numbers to an existing value.

The value may be empty or already contain numeric or textual values.

If the current value is textual, the numbers provided are converted to text. For the case of numeric values, the given numbers are converted to the current number type through casting, meaning that loss of precision may occur. If this is undesirable, read the current value and replace it manually.

An error is returned if the current value is not compatible with the insertion of integers, such as Tag or Date.

§Example
use dicom_core::dicom_value;

let mut value = dicom_value!(F64, [1., 2.]);
value.extend_f64([5.])?;
assert_eq!(value.to_multi_float64()?, vec![1., 2., 5.]);

let mut value = dicom_value!(Strs, ["1.25"]);
value.extend_f64([0.5])?;
assert_eq!(value.to_string(), "1.25\\0.5");
source

pub fn truncate(&mut self, limit: usize)

Shorten this value by removing trailing elements to fit the given limit.

Elements are counted by the number of individual value items (note that bytes in a PrimitiveValue::U8 are treated as individual items).

Nothing is done if the value’s cardinality is already lower than or equal to the limit.

§Example
let mut value = dicom_value!(I32, [1, 2, 5]);
value.truncate(2);
assert_eq!(value.to_multi_int::<i32>()?, vec![1, 2]);

value.truncate(0);
assert_eq!(value.multiplicity(), 0);

Trait Implementations§

source§

impl Clone for PrimitiveValue

source§

fn clone(&self) -> PrimitiveValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PrimitiveValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl DicomValueType for PrimitiveValue

source§

fn value_type(&self) -> ValueType

Retrieve the specific type of this value.
source§

fn cardinality(&self) -> usize

Retrieve the number of elements contained in the DICOM value. Read more
source§

impl Display for PrimitiveValue

The output of this method is equivalent to calling the method to_str

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&[DicomDate; 1]> for PrimitiveValue

source§

fn from(value: &[DicomDate; 1]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDate; 2]> for PrimitiveValue

source§

fn from(value: &[DicomDate; 2]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDate; 3]> for PrimitiveValue

source§

fn from(value: &[DicomDate; 3]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDate; 4]> for PrimitiveValue

source§

fn from(value: &[DicomDate; 4]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDate; 5]> for PrimitiveValue

source§

fn from(value: &[DicomDate; 5]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDate; 6]> for PrimitiveValue

source§

fn from(value: &[DicomDate; 6]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDate; 7]> for PrimitiveValue

source§

fn from(value: &[DicomDate; 7]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDate; 8]> for PrimitiveValue

source§

fn from(value: &[DicomDate; 8]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDateTime; 1]> for PrimitiveValue

source§

fn from(value: &[DicomDateTime; 1]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDateTime; 2]> for PrimitiveValue

source§

fn from(value: &[DicomDateTime; 2]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDateTime; 3]> for PrimitiveValue

source§

fn from(value: &[DicomDateTime; 3]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDateTime; 4]> for PrimitiveValue

source§

fn from(value: &[DicomDateTime; 4]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDateTime; 5]> for PrimitiveValue

source§

fn from(value: &[DicomDateTime; 5]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDateTime; 6]> for PrimitiveValue

source§

fn from(value: &[DicomDateTime; 6]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDateTime; 7]> for PrimitiveValue

source§

fn from(value: &[DicomDateTime; 7]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomDateTime; 8]> for PrimitiveValue

source§

fn from(value: &[DicomDateTime; 8]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomTime; 1]> for PrimitiveValue

source§

fn from(value: &[DicomTime; 1]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomTime; 2]> for PrimitiveValue

source§

fn from(value: &[DicomTime; 2]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomTime; 3]> for PrimitiveValue

source§

fn from(value: &[DicomTime; 3]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomTime; 4]> for PrimitiveValue

source§

fn from(value: &[DicomTime; 4]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomTime; 5]> for PrimitiveValue

source§

fn from(value: &[DicomTime; 5]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomTime; 6]> for PrimitiveValue

source§

fn from(value: &[DicomTime; 6]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomTime; 7]> for PrimitiveValue

source§

fn from(value: &[DicomTime; 7]) -> Self

Converts to this type from the input type.
source§

impl From<&[DicomTime; 8]> for PrimitiveValue

source§

fn from(value: &[DicomTime; 8]) -> Self

Converts to this type from the input type.
source§

impl From<&[f32; 1]> for PrimitiveValue

source§

fn from(value: &[f32; 1]) -> Self

Converts to this type from the input type.
source§

impl From<&[f32; 2]> for PrimitiveValue

source§

fn from(value: &[f32; 2]) -> Self

Converts to this type from the input type.
source§

impl From<&[f32; 3]> for PrimitiveValue

source§

fn from(value: &[f32; 3]) -> Self

Converts to this type from the input type.
source§

impl From<&[f32; 4]> for PrimitiveValue

source§

fn from(value: &[f32; 4]) -> Self

Converts to this type from the input type.
source§

impl From<&[f32; 5]> for PrimitiveValue

source§

fn from(value: &[f32; 5]) -> Self

Converts to this type from the input type.
source§

impl From<&[f32; 6]> for PrimitiveValue

source§

fn from(value: &[f32; 6]) -> Self

Converts to this type from the input type.
source§

impl From<&[f32; 7]> for PrimitiveValue

source§

fn from(value: &[f32; 7]) -> Self

Converts to this type from the input type.
source§

impl From<&[f32; 8]> for PrimitiveValue

source§

fn from(value: &[f32; 8]) -> Self

Converts to this type from the input type.
source§

impl From<&[f64; 1]> for PrimitiveValue

source§

fn from(value: &[f64; 1]) -> Self

Converts to this type from the input type.
source§

impl From<&[f64; 2]> for PrimitiveValue

source§

fn from(value: &[f64; 2]) -> Self

Converts to this type from the input type.
source§

impl From<&[f64; 3]> for PrimitiveValue

source§

fn from(value: &[f64; 3]) -> Self

Converts to this type from the input type.
source§

impl From<&[f64; 4]> for PrimitiveValue

source§

fn from(value: &[f64; 4]) -> Self

Converts to this type from the input type.
source§

impl From<&[f64; 5]> for PrimitiveValue

source§

fn from(value: &[f64; 5]) -> Self

Converts to this type from the input type.
source§

impl From<&[f64; 6]> for PrimitiveValue

source§

fn from(value: &[f64; 6]) -> Self

Converts to this type from the input type.
source§

impl From<&[f64; 7]> for PrimitiveValue

source§

fn from(value: &[f64; 7]) -> Self

Converts to this type from the input type.
source§

impl From<&[f64; 8]> for PrimitiveValue

source§

fn from(value: &[f64; 8]) -> Self

Converts to this type from the input type.
source§

impl From<&[i16; 1]> for PrimitiveValue

source§

fn from(value: &[i16; 1]) -> Self

Converts to this type from the input type.
source§

impl From<&[i16; 2]> for PrimitiveValue

source§

fn from(value: &[i16; 2]) -> Self

Converts to this type from the input type.
source§

impl From<&[i16; 3]> for PrimitiveValue

source§

fn from(value: &[i16; 3]) -> Self

Converts to this type from the input type.
source§

impl From<&[i16; 4]> for PrimitiveValue

source§

fn from(value: &[i16; 4]) -> Self

Converts to this type from the input type.
source§

impl From<&[i16; 5]> for PrimitiveValue

source§

fn from(value: &[i16; 5]) -> Self

Converts to this type from the input type.
source§

impl From<&[i16; 6]> for PrimitiveValue

source§

fn from(value: &[i16; 6]) -> Self

Converts to this type from the input type.
source§

impl From<&[i16; 7]> for PrimitiveValue

source§

fn from(value: &[i16; 7]) -> Self

Converts to this type from the input type.
source§

impl From<&[i16; 8]> for PrimitiveValue

source§

fn from(value: &[i16; 8]) -> Self

Converts to this type from the input type.
source§

impl From<&[i32; 1]> for PrimitiveValue

source§

fn from(value: &[i32; 1]) -> Self

Converts to this type from the input type.
source§

impl From<&[i32; 2]> for PrimitiveValue

source§

fn from(value: &[i32; 2]) -> Self

Converts to this type from the input type.
source§

impl From<&[i32; 3]> for PrimitiveValue

source§

fn from(value: &[i32; 3]) -> Self

Converts to this type from the input type.
source§

impl From<&[i32; 4]> for PrimitiveValue

source§

fn from(value: &[i32; 4]) -> Self

Converts to this type from the input type.
source§

impl From<&[i32; 5]> for PrimitiveValue

source§

fn from(value: &[i32; 5]) -> Self

Converts to this type from the input type.
source§

impl From<&[i32; 6]> for PrimitiveValue

source§

fn from(value: &[i32; 6]) -> Self

Converts to this type from the input type.
source§

impl From<&[i32; 7]> for PrimitiveValue

source§

fn from(value: &[i32; 7]) -> Self

Converts to this type from the input type.
source§

impl From<&[i32; 8]> for PrimitiveValue

source§

fn from(value: &[i32; 8]) -> Self

Converts to this type from the input type.
source§

impl From<&[i64; 1]> for PrimitiveValue

source§

fn from(value: &[i64; 1]) -> Self

Converts to this type from the input type.
source§

impl From<&[i64; 2]> for PrimitiveValue

source§

fn from(value: &[i64; 2]) -> Self

Converts to this type from the input type.
source§

impl From<&[i64; 3]> for PrimitiveValue

source§

fn from(value: &[i64; 3]) -> Self

Converts to this type from the input type.
source§

impl From<&[i64; 4]> for PrimitiveValue

source§

fn from(value: &[i64; 4]) -> Self

Converts to this type from the input type.
source§

impl From<&[i64; 5]> for PrimitiveValue

source§

fn from(value: &[i64; 5]) -> Self

Converts to this type from the input type.
source§

impl From<&[i64; 6]> for PrimitiveValue

source§

fn from(value: &[i64; 6]) -> Self

Converts to this type from the input type.
source§

impl From<&[i64; 7]> for PrimitiveValue

source§

fn from(value: &[i64; 7]) -> Self

Converts to this type from the input type.
source§

impl From<&[i64; 8]> for PrimitiveValue

source§

fn from(value: &[i64; 8]) -> Self

Converts to this type from the input type.
source§

impl From<&[u16; 1]> for PrimitiveValue

source§

fn from(value: &[u16; 1]) -> Self

Converts to this type from the input type.
source§

impl From<&[u16; 2]> for PrimitiveValue

source§

fn from(value: &[u16; 2]) -> Self

Converts to this type from the input type.
source§

impl From<&[u16; 3]> for PrimitiveValue

source§

fn from(value: &[u16; 3]) -> Self

Converts to this type from the input type.
source§

impl From<&[u16; 4]> for PrimitiveValue

source§

fn from(value: &[u16; 4]) -> Self

Converts to this type from the input type.
source§

impl From<&[u16; 5]> for PrimitiveValue

source§

fn from(value: &[u16; 5]) -> Self

Converts to this type from the input type.
source§

impl From<&[u16; 6]> for PrimitiveValue

source§

fn from(value: &[u16; 6]) -> Self

Converts to this type from the input type.
source§

impl From<&[u16; 7]> for PrimitiveValue

source§

fn from(value: &[u16; 7]) -> Self

Converts to this type from the input type.
source§

impl From<&[u16; 8]> for PrimitiveValue

source§

fn from(value: &[u16; 8]) -> Self

Converts to this type from the input type.
source§

impl From<&[u32; 1]> for PrimitiveValue

source§

fn from(value: &[u32; 1]) -> Self

Converts to this type from the input type.
source§

impl From<&[u32; 2]> for PrimitiveValue

source§

fn from(value: &[u32; 2]) -> Self

Converts to this type from the input type.
source§

impl From<&[u32; 3]> for PrimitiveValue

source§

fn from(value: &[u32; 3]) -> Self

Converts to this type from the input type.
source§

impl From<&[u32; 4]> for PrimitiveValue

source§

fn from(value: &[u32; 4]) -> Self

Converts to this type from the input type.
source§

impl From<&[u32; 5]> for PrimitiveValue

source§

fn from(value: &[u32; 5]) -> Self

Converts to this type from the input type.
source§

impl From<&[u32; 6]> for PrimitiveValue

source§

fn from(value: &[u32; 6]) -> Self

Converts to this type from the input type.
source§

impl From<&[u32; 7]> for PrimitiveValue

source§

fn from(value: &[u32; 7]) -> Self

Converts to this type from the input type.
source§

impl From<&[u32; 8]> for PrimitiveValue

source§

fn from(value: &[u32; 8]) -> Self

Converts to this type from the input type.
source§

impl From<&[u64; 1]> for PrimitiveValue

source§

fn from(value: &[u64; 1]) -> Self

Converts to this type from the input type.
source§

impl From<&[u64; 2]> for PrimitiveValue

source§

fn from(value: &[u64; 2]) -> Self

Converts to this type from the input type.
source§

impl From<&[u64; 3]> for PrimitiveValue

source§

fn from(value: &[u64; 3]) -> Self

Converts to this type from the input type.
source§

impl From<&[u64; 4]> for PrimitiveValue

source§

fn from(value: &[u64; 4]) -> Self

Converts to this type from the input type.
source§

impl From<&[u64; 5]> for PrimitiveValue

source§

fn from(value: &[u64; 5]) -> Self

Converts to this type from the input type.
source§

impl From<&[u64; 6]> for PrimitiveValue

source§

fn from(value: &[u64; 6]) -> Self

Converts to this type from the input type.
source§

impl From<&[u64; 7]> for PrimitiveValue

source§

fn from(value: &[u64; 7]) -> Self

Converts to this type from the input type.
source§

impl From<&[u64; 8]> for PrimitiveValue

source§

fn from(value: &[u64; 8]) -> Self

Converts to this type from the input type.
source§

impl From<&[u8]> for PrimitiveValue

source§

fn from(value: &[u8]) -> Self

Converts to this type from the input type.
source§

impl From<&[u8; 1]> for PrimitiveValue

source§

fn from(value: &[u8; 1]) -> Self

Converts to this type from the input type.
source§

impl From<&[u8; 2]> for PrimitiveValue

source§

fn from(value: &[u8; 2]) -> Self

Converts to this type from the input type.
source§

impl From<&[u8; 3]> for PrimitiveValue

source§

fn from(value: &[u8; 3]) -> Self

Converts to this type from the input type.
source§

impl From<&[u8; 4]> for PrimitiveValue

source§

fn from(value: &[u8; 4]) -> Self

Converts to this type from the input type.
source§

impl From<&[u8; 5]> for PrimitiveValue

source§

fn from(value: &[u8; 5]) -> Self

Converts to this type from the input type.
source§

impl From<&[u8; 6]> for PrimitiveValue

source§

fn from(value: &[u8; 6]) -> Self

Converts to this type from the input type.
source§

impl From<&[u8; 7]> for PrimitiveValue

source§

fn from(value: &[u8; 7]) -> Self

Converts to this type from the input type.
source§

impl From<&[u8; 8]> for PrimitiveValue

source§

fn from(value: &[u8; 8]) -> Self

Converts to this type from the input type.
source§

impl From<&str> for PrimitiveValue

source§

fn from(value: &str) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDate; 1]> for PrimitiveValue

source§

fn from(value: [DicomDate; 1]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDate; 2]> for PrimitiveValue

source§

fn from(value: [DicomDate; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDate; 3]> for PrimitiveValue

source§

fn from(value: [DicomDate; 3]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDate; 4]> for PrimitiveValue

source§

fn from(value: [DicomDate; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDate; 5]> for PrimitiveValue

source§

fn from(value: [DicomDate; 5]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDate; 6]> for PrimitiveValue

source§

fn from(value: [DicomDate; 6]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDate; 7]> for PrimitiveValue

source§

fn from(value: [DicomDate; 7]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDate; 8]> for PrimitiveValue

source§

fn from(value: [DicomDate; 8]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDateTime; 1]> for PrimitiveValue

source§

fn from(value: [DicomDateTime; 1]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDateTime; 2]> for PrimitiveValue

source§

fn from(value: [DicomDateTime; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDateTime; 3]> for PrimitiveValue

source§

fn from(value: [DicomDateTime; 3]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDateTime; 4]> for PrimitiveValue

source§

fn from(value: [DicomDateTime; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDateTime; 5]> for PrimitiveValue

source§

fn from(value: [DicomDateTime; 5]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDateTime; 6]> for PrimitiveValue

source§

fn from(value: [DicomDateTime; 6]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDateTime; 7]> for PrimitiveValue

source§

fn from(value: [DicomDateTime; 7]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomDateTime; 8]> for PrimitiveValue

source§

fn from(value: [DicomDateTime; 8]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomTime; 1]> for PrimitiveValue

source§

fn from(value: [DicomTime; 1]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomTime; 2]> for PrimitiveValue

source§

fn from(value: [DicomTime; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomTime; 3]> for PrimitiveValue

source§

fn from(value: [DicomTime; 3]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomTime; 4]> for PrimitiveValue

source§

fn from(value: [DicomTime; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomTime; 5]> for PrimitiveValue

source§

fn from(value: [DicomTime; 5]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomTime; 6]> for PrimitiveValue

source§

fn from(value: [DicomTime; 6]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomTime; 7]> for PrimitiveValue

source§

fn from(value: [DicomTime; 7]) -> Self

Converts to this type from the input type.
source§

impl From<[DicomTime; 8]> for PrimitiveValue

source§

fn from(value: [DicomTime; 8]) -> Self

Converts to this type from the input type.
source§

impl From<[f32; 1]> for PrimitiveValue

source§

fn from(value: [f32; 1]) -> Self

Converts to this type from the input type.
source§

impl From<[f32; 2]> for PrimitiveValue

source§

fn from(value: [f32; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[f32; 3]> for PrimitiveValue

source§

fn from(value: [f32; 3]) -> Self

Converts to this type from the input type.
source§

impl From<[f32; 4]> for PrimitiveValue

source§

fn from(value: [f32; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[f32; 5]> for PrimitiveValue

source§

fn from(value: [f32; 5]) -> Self

Converts to this type from the input type.
source§

impl From<[f32; 6]> for PrimitiveValue

source§

fn from(value: [f32; 6]) -> Self

Converts to this type from the input type.
source§

impl From<[f32; 7]> for PrimitiveValue

source§

fn from(value: [f32; 7]) -> Self

Converts to this type from the input type.
source§

impl From<[f32; 8]> for PrimitiveValue

source§

fn from(value: [f32; 8]) -> Self

Converts to this type from the input type.
source§

impl From<[f64; 1]> for PrimitiveValue

source§

fn from(value: [f64; 1]) -> Self

Converts to this type from the input type.
source§

impl From<[f64; 2]> for PrimitiveValue

source§

fn from(value: [f64; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[f64; 3]> for PrimitiveValue

source§

fn from(value: [f64; 3]) -> Self

Converts to this type from the input type.
source§

impl From<[f64; 4]> for PrimitiveValue

source§

fn from(value: [f64; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[f64; 5]> for PrimitiveValue

source§

fn from(value: [f64; 5]) -> Self

Converts to this type from the input type.
source§

impl From<[f64; 6]> for PrimitiveValue

source§

fn from(value: [f64; 6]) -> Self

Converts to this type from the input type.
source§

impl From<[f64; 7]> for PrimitiveValue

source§

fn from(value: [f64; 7]) -> Self

Converts to this type from the input type.
source§

impl From<[f64; 8]> for PrimitiveValue

source§

fn from(value: [f64; 8]) -> Self

Converts to this type from the input type.
source§

impl From<[i16; 1]> for PrimitiveValue

source§

fn from(value: [i16; 1]) -> Self

Converts to this type from the input type.
source§

impl From<[i16; 2]> for PrimitiveValue

source§

fn from(value: [i16; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[i16; 3]> for PrimitiveValue

source§

fn from(value: [i16; 3]) -> Self

Converts to this type from the input type.
source§

impl From<[i16; 4]> for PrimitiveValue

source§

fn from(value: [i16; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[i16; 5]> for PrimitiveValue

source§

fn from(value: [i16; 5]) -> Self

Converts to this type from the input type.
source§

impl From<[i16; 6]> for PrimitiveValue

source§

fn from(value: [i16; 6]) -> Self

Converts to this type from the input type.
source§

impl From<[i16; 7]> for PrimitiveValue

source§

fn from(value: [i16; 7]) -> Self

Converts to this type from the input type.
source§

impl From<[i16; 8]> for PrimitiveValue

source§

fn from(value: [i16; 8]) -> Self

Converts to this type from the input type.
source§

impl From<[i32; 1]> for PrimitiveValue

source§

fn from(value: [i32; 1]) -> Self

Converts to this type from the input type.
source§

impl From<[i32; 2]> for PrimitiveValue

source§

fn from(value: [i32; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[i32; 3]> for PrimitiveValue

source§

fn from(value: [i32; 3]) -> Self

Converts to this type from the input type.
source§

impl From<[i32; 4]> for PrimitiveValue

source§

fn from(value: [i32; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[i32; 5]> for PrimitiveValue

source§

fn from(value: [i32; 5]) -> Self

Converts to this type from the input type.
source§

impl From<[i32; 6]> for PrimitiveValue

source§

fn from(value: [i32; 6]) -> Self

Converts to this type from the input type.
source§

impl From<[i32; 7]> for PrimitiveValue

source§

fn from(value: [i32; 7]) -> Self

Converts to this type from the input type.
source§

impl From<[i32; 8]> for PrimitiveValue

source§

fn from(value: [i32; 8]) -> Self

Converts to this type from the input type.
source§

impl From<[i64; 1]> for PrimitiveValue

source§

fn from(value: [i64; 1]) -> Self

Converts to this type from the input type.
source§

impl From<[i64; 2]> for PrimitiveValue

source§

fn from(value: [i64; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[i64; 3]> for PrimitiveValue

source§

fn from(value: [i64; 3]) -> Self

Converts to this type from the input type.
source§

impl From<[i64; 4]> for PrimitiveValue

source§

fn from(value: [i64; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[i64; 5]> for PrimitiveValue

source§

fn from(value: [i64; 5]) -> Self

Converts to this type from the input type.
source§

impl From<[i64; 6]> for PrimitiveValue

source§

fn from(value: [i64; 6]) -> Self

Converts to this type from the input type.
source§

impl From<[i64; 7]> for PrimitiveValue

source§

fn from(value: [i64; 7]) -> Self

Converts to this type from the input type.
source§

impl From<[i64; 8]> for PrimitiveValue

source§

fn from(value: [i64; 8]) -> Self

Converts to this type from the input type.
source§

impl From<[u16; 1]> for PrimitiveValue

source§

fn from(value: [u16; 1]) -> Self

Converts to this type from the input type.
source§

impl From<[u16; 2]> for PrimitiveValue

source§

fn from(value: [u16; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[u16; 3]> for PrimitiveValue

source§

fn from(value: [u16; 3]) -> Self

Converts to this type from the input type.
source§

impl From<[u16; 4]> for PrimitiveValue

source§

fn from(value: [u16; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[u16; 5]> for PrimitiveValue

source§

fn from(value: [u16; 5]) -> Self

Converts to this type from the input type.
source§

impl From<[u16; 6]> for PrimitiveValue

source§

fn from(value: [u16; 6]) -> Self

Converts to this type from the input type.
source§

impl From<[u16; 7]> for PrimitiveValue

source§

fn from(value: [u16; 7]) -> Self

Converts to this type from the input type.
source§

impl From<[u16; 8]> for PrimitiveValue

source§

fn from(value: [u16; 8]) -> Self

Converts to this type from the input type.
source§

impl From<[u32; 1]> for PrimitiveValue

source§

fn from(value: [u32; 1]) -> Self

Converts to this type from the input type.
source§

impl From<[u32; 2]> for PrimitiveValue

source§

fn from(value: [u32; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[u32; 3]> for PrimitiveValue

source§

fn from(value: [u32; 3]) -> Self

Converts to this type from the input type.
source§

impl From<[u32; 4]> for PrimitiveValue

source§

fn from(value: [u32; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[u32; 5]> for PrimitiveValue

source§

fn from(value: [u32; 5]) -> Self

Converts to this type from the input type.
source§

impl From<[u32; 6]> for PrimitiveValue

source§

fn from(value: [u32; 6]) -> Self

Converts to this type from the input type.
source§

impl From<[u32; 7]> for PrimitiveValue

source§

fn from(value: [u32; 7]) -> Self

Converts to this type from the input type.
source§

impl From<[u32; 8]> for PrimitiveValue

source§

fn from(value: [u32; 8]) -> Self

Converts to this type from the input type.
source§

impl From<[u64; 1]> for PrimitiveValue

source§

fn from(value: [u64; 1]) -> Self

Converts to this type from the input type.
source§

impl From<[u64; 2]> for PrimitiveValue

source§

fn from(value: [u64; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[u64; 3]> for PrimitiveValue

source§

fn from(value: [u64; 3]) -> Self

Converts to this type from the input type.
source§

impl From<[u64; 4]> for PrimitiveValue

source§

fn from(value: [u64; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[u64; 5]> for PrimitiveValue

source§

fn from(value: [u64; 5]) -> Self

Converts to this type from the input type.
source§

impl From<[u64; 6]> for PrimitiveValue

source§

fn from(value: [u64; 6]) -> Self

Converts to this type from the input type.
source§

impl From<[u64; 7]> for PrimitiveValue

source§

fn from(value: [u64; 7]) -> Self

Converts to this type from the input type.
source§

impl From<[u64; 8]> for PrimitiveValue

source§

fn from(value: [u64; 8]) -> Self

Converts to this type from the input type.
source§

impl From<[u8; 1]> for PrimitiveValue

source§

fn from(value: [u8; 1]) -> Self

Converts to this type from the input type.
source§

impl From<[u8; 2]> for PrimitiveValue

source§

fn from(value: [u8; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[u8; 3]> for PrimitiveValue

source§

fn from(value: [u8; 3]) -> Self

Converts to this type from the input type.
source§

impl From<[u8; 4]> for PrimitiveValue

source§

fn from(value: [u8; 4]) -> Self

Converts to this type from the input type.
source§

impl From<[u8; 5]> for PrimitiveValue

source§

fn from(value: [u8; 5]) -> Self

Converts to this type from the input type.
source§

impl From<[u8; 6]> for PrimitiveValue

source§

fn from(value: [u8; 6]) -> Self

Converts to this type from the input type.
source§

impl From<[u8; 7]> for PrimitiveValue

source§

fn from(value: [u8; 7]) -> Self

Converts to this type from the input type.
source§

impl From<[u8; 8]> for PrimitiveValue

source§

fn from(value: [u8; 8]) -> Self

Converts to this type from the input type.
source§

impl From<()> for PrimitiveValue

source§

fn from(_value: ()) -> Self

constructs an empty DICOM value

source§

impl From<DicomDate> for PrimitiveValue

source§

fn from(value: DicomDate) -> Self

Converts to this type from the input type.
source§

impl From<DicomDateTime> for PrimitiveValue

source§

fn from(value: DicomDateTime) -> Self

Converts to this type from the input type.
source§

impl From<DicomTime> for PrimitiveValue

source§

fn from(value: DicomTime) -> Self

Converts to this type from the input type.
source§

impl<'a> From<PersonName<'a>> for PrimitiveValue

source§

fn from(p: PersonName<'_>) -> Self

Converts to this type from the input type.
source§

impl<I, P> From<PrimitiveValue> for Value<I, P>

source§

fn from(v: PrimitiveValue) -> Self

Converts to this type from the input type.
source§

impl From<String> for PrimitiveValue

source§

fn from(value: String) -> Self

Converts to this type from the input type.
source§

impl From<Tag> for PrimitiveValue

source§

fn from(value: Tag) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for PrimitiveValue

source§

fn from(value: Vec<u8>) -> Self

Converts to this type from the input type.
source§

impl From<f32> for PrimitiveValue

source§

fn from(value: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for PrimitiveValue

source§

fn from(value: f64) -> Self

Converts to this type from the input type.
source§

impl From<i16> for PrimitiveValue

source§

fn from(value: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for PrimitiveValue

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for PrimitiveValue

source§

fn from(value: i64) -> Self

Converts to this type from the input type.
source§

impl From<u16> for PrimitiveValue

source§

fn from(value: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for PrimitiveValue

source§

fn from(value: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for PrimitiveValue

source§

fn from(value: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for PrimitiveValue

source§

fn from(value: u8) -> Self

Converts to this type from the input type.
source§

impl HasLength for PrimitiveValue

source§

fn length(&self) -> Length

Retrieve the value data’s length as specified by the data element or item, in bytes. Read more
source§

fn is_empty(&self) -> bool

Check whether the value is empty (0 length).
source§

impl PartialEq<&str> for PrimitiveValue

source§

fn eq(&self, other: &&str) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<str> for PrimitiveValue

source§

fn eq(&self, other: &str) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for PrimitiveValue

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.