pub enum ZonedEncodingFormat {
Ascii,
Ebcdic,
Auto,
}Expand description
Zoned decimal encoding format (ASCII, EBCDIC, or auto-detect). Zoned decimal encoding format specification for round-trip fidelity.
This enum controls how zoned decimal fields are encoded and decoded, enabling preservation of the original encoding format during round-trip operations for enterprise data consistency.
§Examples
use copybook_zoned_format::ZonedEncodingFormat;
let fmt = ZonedEncodingFormat::default();
assert!(fmt.is_auto());
assert_eq!(fmt.description(), "Automatic detection based on zone nibbles");
let detected = ZonedEncodingFormat::detect_from_byte(0xF5);
assert_eq!(detected, Some(ZonedEncodingFormat::Ebcdic));Variants§
Ascii
ASCII digit zones (0x30-0x39).
Ebcdic
EBCDIC digit zones (0xF0-0xF9).
Auto
Automatic detection based on zone nibbles.
Implementations§
Source§impl ZonedEncodingFormat
impl ZonedEncodingFormat
Sourcepub const fn description(self) -> &'static str
pub const fn description(self) -> &'static str
Get a human-readable description of the encoding format.
Sourcepub fn detect_from_byte(byte: u8) -> Option<ZonedEncodingFormat>
pub fn detect_from_byte(byte: u8) -> Option<ZonedEncodingFormat>
Detect encoding format from a single byte of zoned decimal data.
Examines the zone nibble (upper 4 bits) to determine the encoding
format. Returns None for invalid zone values.
Trait Implementations§
Source§impl Clone for ZonedEncodingFormat
impl Clone for ZonedEncodingFormat
Source§fn clone(&self) -> ZonedEncodingFormat
fn clone(&self) -> ZonedEncodingFormat
Returns a duplicate 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 ZonedEncodingFormat
impl Debug for ZonedEncodingFormat
Source§impl Default for ZonedEncodingFormat
impl Default for ZonedEncodingFormat
Source§fn default() -> ZonedEncodingFormat
fn default() -> ZonedEncodingFormat
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ZonedEncodingFormat
impl<'de> Deserialize<'de> for ZonedEncodingFormat
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ZonedEncodingFormat, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ZonedEncodingFormat, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ZonedEncodingFormat
impl Display for ZonedEncodingFormat
Source§impl PartialEq for ZonedEncodingFormat
impl PartialEq for ZonedEncodingFormat
Source§impl Serialize for ZonedEncodingFormat
impl Serialize for ZonedEncodingFormat
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl ValueEnum for ZonedEncodingFormat
impl ValueEnum for ZonedEncodingFormat
Source§fn value_variants<'a>() -> &'a [ZonedEncodingFormat]
fn value_variants<'a>() -> &'a [ZonedEncodingFormat]
All possible argument values, in display order.
Source§fn to_possible_value<'a>(&self) -> Option<PossibleValue>
fn to_possible_value<'a>(&self) -> Option<PossibleValue>
The canonical argument value. Read more
impl Copy for ZonedEncodingFormat
impl Eq for ZonedEncodingFormat
impl StructuralPartialEq for ZonedEncodingFormat
Auto Trait Implementations§
impl Freeze for ZonedEncodingFormat
impl RefUnwindSafe for ZonedEncodingFormat
impl Send for ZonedEncodingFormat
impl Sync for ZonedEncodingFormat
impl Unpin for ZonedEncodingFormat
impl UnsafeUnpin for ZonedEncodingFormat
impl UnwindSafe for ZonedEncodingFormat
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