pub struct ScriptLangTag<'a> {
pub raw: &'a str,
}Expand description
[language "-"] script ["-" region] *("-" variant) *("-" extension) ["-" privateuse] per §5.7.6.3, kept as the raw
ASCII slice. The splitter (script_lang_tags) only enforces
the surface grammar (non-empty, ASCII, hyphen-separated
subtags); deeper validation against the IANA Language Subtag
Registry and ISO 15924 is left to the caller.
Fields§
§raw: &'a strRaw ASCII bytes of the tag, hyphens included, trimmed of surrounding whitespace.
Implementations§
Source§impl<'a> ScriptLangTag<'a>
impl<'a> ScriptLangTag<'a>
Subtags split on the - separator. Per §5.7.6.3 the script
subtag is mandatory; the parser does not assume a position,
so this is the raw split.
Sourcepub fn subtag_count(&self) -> usize
pub fn subtag_count(&self) -> usize
Number of subtags in the tag (hyphen-separated).
Trait Implementations§
Source§impl<'a> Clone for ScriptLangTag<'a>
impl<'a> Clone for ScriptLangTag<'a>
Source§fn clone(&self) -> ScriptLangTag<'a>
fn clone(&self) -> ScriptLangTag<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for ScriptLangTag<'a>
Source§impl<'a> Debug for ScriptLangTag<'a>
impl<'a> Debug for ScriptLangTag<'a>
impl<'a> Eq for ScriptLangTag<'a>
Source§impl<'a> PartialEq for ScriptLangTag<'a>
impl<'a> PartialEq for ScriptLangTag<'a>
impl<'a> StructuralPartialEq for ScriptLangTag<'a>
Auto Trait Implementations§
impl<'a> Freeze for ScriptLangTag<'a>
impl<'a> RefUnwindSafe for ScriptLangTag<'a>
impl<'a> Send for ScriptLangTag<'a>
impl<'a> Sync for ScriptLangTag<'a>
impl<'a> Unpin for ScriptLangTag<'a>
impl<'a> UnsafeUnpin for ScriptLangTag<'a>
impl<'a> UnwindSafe for ScriptLangTag<'a>
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