#![allow(dead_code)] #![allow(non_upper_case_globals)] use std::hash::{Hash, Hasher}; pub struct UID { uid: &'static str, ident: &'static str, name: &'static str, } impl PartialEq for UID { fn eq(&self, other: &UID) -> bool { self.uid.eq(other.uid) } } impl Hash for UID { fn hash(&self, state: &mut H) { self.uid.hash(state); } } /// Implicit VR Little Endian - Transfer Syntax, "1.2.840.10008.1.2" pub static ImplicitVRLittleEndian: &'static UID = &UID { uid: "1.2.840.10008.1.2", ident: "ImplicitVRLittleEndian", name: "Implicit VR Little Endian", }; pub struct TransferSyntax { uid: &'static UID, big_endian: bool, explicit_vr: bool, deflated: bool, encapsulated: bool, } impl TransferSyntax { pub fn new(uid: &'static UID, big_endian: bool, explicit_vr: bool, deflated: bool, encapsulated: bool) -> TransferSyntax { TransferSyntax { uid: uid, big_endian: big_endian, explicit_vr: explicit_vr, deflated: deflated, encapsulated: encapsulated, } } pub fn get_uid(&self) -> &'static UID { self.uid } pub fn is_big_endian(&self) -> bool { self.big_endian } pub fn is_explicit_vr(&self) -> bool { self.explicit_vr } pub fn is_deflated(&self) -> bool { self.deflated } pub fn is_encapsulated(&self) -> bool { self.encapsulated } pub fn uncompressed(&self) -> bool { !self.deflated && !self.encapsulated } } impl PartialEq for TransferSyntax { fn eq(&self, other: &TransferSyntax) -> bool { self.uid.eq(other.uid) } } impl Hash for TransferSyntax { fn hash(&self, state: &mut H) { self.uid.hash(state); } } pub static ImplicitVRLittleEndian_TS: &'static TransferSyntax = &TransferSyntax { uid: &ImplicitVRLittleEndian, big_endian: false, explicit_vr: false, deflated: false, encapsulated: false, }; fn main() { println!("Hello, world!"); }