pub struct SpecificCharacterSet(/* private fields */);
Expand description
A descriptor for a specific character set, taking part in text encoding and decoding as per PS3.5 ch 6 6.1.
§Example
Use from_code
or one of the associated constants to create a character set.
From there, use the TextCodec
trait to encode and decode text.
use dicom_encoding::text::{SpecificCharacterSet, TextCodec};
let character_set = SpecificCharacterSet::from_code("ISO_IR 100").unwrap();
assert_eq!(character_set, SpecificCharacterSet::ISO_IR_100);
Implementations§
Source§impl SpecificCharacterSet
impl SpecificCharacterSet
Sourcepub const ISO_IR_6: SpecificCharacterSet = _
pub const ISO_IR_6: SpecificCharacterSet = _
ISO IR 6: The default character set, as defined by the DICOM standard.
pub const ISO_IR_100: SpecificCharacterSet = _
Sourcepub const ISO_IR_192: SpecificCharacterSet = _
pub const ISO_IR_192: SpecificCharacterSet = _
ISO IR 192: UTF-8 encoding
Sourcepub fn from_code(code: &str) -> Option<Self>
pub fn from_code(code: &str) -> Option<Self>
Obtain the specific character set identified by the given code string.
Supported code strings include the possible values in the respective DICOM element (0008, 0005).
§Example
use dicom_encoding::text::{SpecificCharacterSet, TextCodec};
let character_set = SpecificCharacterSet::from_code("ISO_IR 100").unwrap();
assert_eq!(character_set.name(), "ISO_IR 100");
Trait Implementations§
Source§impl Clone for SpecificCharacterSet
impl Clone for SpecificCharacterSet
Source§fn clone(&self) -> SpecificCharacterSet
fn clone(&self) -> SpecificCharacterSet
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SpecificCharacterSet
impl Debug for SpecificCharacterSet
Source§impl Default for SpecificCharacterSet
impl Default for SpecificCharacterSet
Source§fn default() -> SpecificCharacterSet
fn default() -> SpecificCharacterSet
Returns the “default value” for a type. Read more
Source§impl PartialEq for SpecificCharacterSet
impl PartialEq for SpecificCharacterSet
Source§impl TextCodec for SpecificCharacterSet
impl TextCodec for SpecificCharacterSet
Source§fn name(&self) -> Cow<'static, str>
fn name(&self) -> Cow<'static, str>
Obtain the defined term (unique name) of the text encoding,
which may be used as the value of a
Specific Character Set (0008, 0005) element to refer to this codec. Read more
impl StructuralPartialEq for SpecificCharacterSet
Auto Trait Implementations§
impl Freeze for SpecificCharacterSet
impl RefUnwindSafe for SpecificCharacterSet
impl Send for SpecificCharacterSet
impl Sync for SpecificCharacterSet
impl Unpin for SpecificCharacterSet
impl UnwindSafe for SpecificCharacterSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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