| Crates.io | murdoch-charsets |
| lib.rs | murdoch-charsets |
| version | 0.1.0 |
| created_at | 2019-07-13 03:30:08.566647+00 |
| updated_at | 2019-07-13 03:30:08.566647+00 |
| description | provides character-sets type defined by IANA |
| homepage | |
| repository | https://github.com/arkhe634/murdoch |
| max_upload_size | |
| id | 148671 |
| size | 53,499 |
murdoch-charsets provides API for name of character sets defined by Internet Assigned Numbers Authority (IANA).
In all settings, murdoch-charset provides CharacterSet traits and InvalidCharacterSetNameError.
By default, murdoch-charsets provides types corresponding character sets defined by IANA,
and CharacterSetEnum to hold any of them.
You can customize the character sets by using no_charset feature
[dependencies]
murdoch-charsets = { features = [ "no_charset" ] }
then murdoch-charsets exports character_sets! macro.
character_sets!(
UnicodeCharacterSet,
UTF_8, // character-set type/variant name
None, // preferred_mime_name
"UTF-8", // name
["UTF8", "UTF_8",], // aliases
["UTF-8", "UTF8", "UTF_8",], // uppercase set of names (for FromStr)
UTF_16,
None,
"UTF-16",
["UTF16", "UTF_16",],
["UTF-16", "UTF16", "UTF_16",],
UTF_32,
None,
"UTF-32",
["UTF32", "UTF_32",],
["UTF-32", "UTF32", "UTF_32",],
);
By calling the macro as above, the following types and implementations of traits (Debug,
Display, Copy, Clone, PartialEq, Eq, FromStr, AsRef<str>, AsRef<[u8]>) are generated.
pub struct UTF_8;
pub struct UTF_16;
pub struct UTF_32;
pub enum UnicodeCharacterSet
{
UTF_8,
UTF_16,
UTF_32,
}
License: MIT