pub enum Codepage {
ASCII,
CP037,
CP273,
CP500,
CP1047,
CP1140,
}Expand description
Codepage identifier for EBCDIC/ASCII character encoding. Character encoding specification supported by copybook-rs.
Variants§
ASCII
ASCII encoding.
CP037
EBCDIC Code Page 037 (US/Canada).
CP273
EBCDIC Code Page 273 (Germany/Austria).
CP500
EBCDIC Code Page 500 (International).
CP1047
EBCDIC Code Page 1047 (Open Systems).
CP1140
EBCDIC Code Page 1140 (US/Canada with Euro).
Implementations§
Source§impl Codepage
impl Codepage
Sourcepub const fn variants() -> &'static [Codepage; 6]
pub const fn variants() -> &'static [Codepage; 6]
Return all supported codepages in their canonical display order.
Sourcepub const fn code_page_number(self) -> Option<u16>
pub const fn code_page_number(self) -> Option<u16>
Return the numeric codepage identifier, if this is an EBCDIC page.
Sourcepub const fn description(self) -> &'static str
pub const fn description(self) -> &'static str
Return a human-readable description.
Sourcepub fn parse(input: &str) -> Result<Codepage, ParseCodepageError>
pub fn parse(input: &str) -> Result<Codepage, ParseCodepageError>
Parse a codepage and reject unknown values.
§Errors
Returns ParseCodepageError when input is not a supported
codepage spelling.
Trait Implementations§
impl Copy for Codepage
Source§impl<'de> Deserialize<'de> for Codepage
impl<'de> Deserialize<'de> for Codepage
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Codepage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Codepage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Codepage
Source§impl Serialize for Codepage
impl Serialize for Codepage
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
impl StructuralPartialEq for Codepage
Auto Trait Implementations§
impl Freeze for Codepage
impl RefUnwindSafe for Codepage
impl Send for Codepage
impl Sync for Codepage
impl Unpin for Codepage
impl UnsafeUnpin for Codepage
impl UnwindSafe for Codepage
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.