dicom_core/dictionary/
stub.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! This module contains a stub dictionary.

use super::{DataDictionary, DataDictionaryEntryRef};
use crate::header::Tag;

/// An empty attribute dictionary.
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct StubDataDictionary;

impl DataDictionary for StubDataDictionary {
    type Entry = DataDictionaryEntryRef<'static>;
    fn by_name(&self, _: &str) -> Option<&DataDictionaryEntryRef<'static>> {
        None
    }

    fn by_tag(&self, _: Tag) -> Option<&DataDictionaryEntryRef<'static>> {
        None
    }
}

impl DataDictionary for &'_ StubDataDictionary {
    type Entry = DataDictionaryEntryRef<'static>;
    fn by_name(&self, _: &str) -> Option<&DataDictionaryEntryRef<'static>> {
        None
    }

    fn by_tag(&self, _: Tag) -> Option<&DataDictionaryEntryRef<'static>> {
        None
    }
}

impl DataDictionary for Box<StubDataDictionary> {
    type Entry = DataDictionaryEntryRef<'static>;
    fn by_name(&self, _: &str) -> Option<&DataDictionaryEntryRef<'static>> {
        None
    }

    fn by_tag(&self, _: Tag) -> Option<&DataDictionaryEntryRef<'static>> {
        None
    }
}