codes_iso_15924/
lib.rs

1/*!
2This package contains an implementation of the [ISO
315924](https://www.iso.org/standard/81905.html) Information and documentation
4— Codes for the representation of names of scripts specification.
5
6ISO 15924, Codes for the representation of names of scripts, is an
7international standard defining codes for writing systems or scripts (a "set
8of graphic characters used for the written form of one or more languages").
9Each script is given both a four-letter code and a numeric code.
10
11Where possible the codes are derived from ISO 639-2, where the name of a
12script and the name of a language using the script are identical (example:
13Gujarātī ISO 639 guj, ISO 15924 Gujr). Preference is given to the 639-2
14Bibliographical codes, which is different from the otherwise often preferred
15use of the Terminological codes.
16
174-letter ISO 15924 codes are incorporated into the IANA Language Subtag
18Registry for IETF language tags and so can be used in file formats that make
19use of such language tags. For example, they can be used in HTML and XML to
20help Web browsers determine which typeface to use for foreign text. This way
21one could differentiate, for example, between Serbian written in the Cyrillic
22(sr-Cyrl) or Latin (sr-Latn) script, or mark romanized or transliterated text
23as such.
24
25# Example
26
27```rust
28use codes_iso_15924::ScriptCode;
29
30let code = ScriptCode::Rohg;
31
32assert_eq!(code.code(), "Rohg");
33assert_eq!(code.numeric_code(), 167);
34assert_eq!(code.name(), "Hanifi Rohingya");
35assert_eq!(code.property_value_alias(), Some("Hanifi_Rohingya"));
36assert_eq!(code.unicode_version(), "11.0");
37assert_eq!(code.date_string(),"2017-11-21");
38```
39
40# Features
41
42By default only the `serde` feature is enabled.
43
44* `serde` - Enables serialization of the [ScriptCode] type.
45
46*/
47
48#![warn(
49    unknown_lints,
50    // ---------- Stylistic
51    absolute_paths_not_starting_with_crate,
52    elided_lifetimes_in_paths,
53    explicit_outlives_requirements,
54    macro_use_extern_crate,
55    nonstandard_style, /* group */
56    noop_method_call,
57    rust_2018_idioms,
58    single_use_lifetimes,
59    trivial_casts,
60    trivial_numeric_casts,
61    // ---------- Future
62    future_incompatible, /* group */
63    rust_2021_compatibility, /* group */
64    // ---------- Public
65    missing_debug_implementations,
66    // missing_docs,
67    unreachable_pub,
68    // ---------- Unsafe
69    unsafe_code,
70    unsafe_op_in_unsafe_fn,
71    // ---------- Unused
72    unused, /* group */
73)]
74#![deny(
75    // ---------- Public
76    exported_private_dependencies,
77    private_in_public,
78    // ---------- Deprecated
79    anonymous_parameters,
80    bare_trait_objects,
81    ellipsis_inclusive_range_patterns,
82    // ---------- Unsafe
83    deref_nullptr,
84    drop_bounds,
85    dyn_drop,
86)]
87
88// ------------------------------------------------------------------------------------------------
89//
90// The rest of this file is generated by the package build script.
91//
92// ------------------------------------------------------------------------------------------------
93
94include!(concat!(env!("OUT_DIR"), "/generated.rs"));