Struct Other

struct Other { ... }

A list of Other Use Extensions as defined in Unicode Locale Identifier specification.

Those extensions are treated as a pass-through, and no Unicode related behavior depends on them.

Examples

use icu::locale::extensions::other::Other;
use icu::locale::subtags::Subtag;

let subtag1: Subtag = "foo".parse().expect("Failed to parse a Subtag.");
let subtag2: Subtag = "bar".parse().expect("Failed to parse a Subtag.");

let other = Other::from_vec_unchecked(b'a', vec![subtag1, subtag2]);
assert_eq!(&other.to_string(), "a-foo-bar");

Implementations

impl Other

fn to_string(self: &Self) -> String

Converts the given value to a String.

Under the hood, this uses an efficient Writeable implementation. However, in order to avoid allocating a string, it is more efficient to use Writeable directly.

impl Other

fn get_ext_str(self: &Self) -> &str

Gets the tag character for this extension as a &str.

Examples

use icu::locale::Locale;

let loc: Locale = "und-a-hello-world".parse().unwrap();
let other_ext = &loc.extensions.other[0];
assert_eq!(other_ext.get_ext_str(), "a");
fn get_ext(self: &Self) -> char

Gets the tag character for this extension as a char.

Examples

use icu::locale::Locale;

let loc: Locale = "und-a-hello-world".parse().unwrap();
let other_ext = &loc.extensions.other[0];
assert_eq!(other_ext.get_ext(), 'a');
fn get_ext_byte(self: &Self) -> u8

Gets the tag character for this extension as a byte.

Examples

use icu::locale::Locale;

let loc: Locale = "und-a-hello-world".parse().unwrap();
let other_ext = &loc.extensions.other[0];
assert_eq!(other_ext.get_ext_byte(), b'a');

impl Clone for Other

fn clone(self: &Self) -> Other

impl Debug for Other

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Default for Other

fn default() -> Other

impl Display for Other

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Eq for Other

impl Freeze for Other

impl Hash for Other

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl Ord for Other

fn cmp(self: &Self, other: &Other) -> Ordering

impl PartialEq for Other

fn eq(self: &Self, other: &Other) -> bool

impl PartialOrd for Other

fn partial_cmp(self: &Self, other: &Other) -> Option<Ordering>

impl RefUnwindSafe for Other

impl Send for Other

impl StructuralPartialEq for Other

impl Sync for Other

impl Unpin for Other

impl UnsafeUnpin for Other

impl UnwindSafe for Other

impl Writeable for Other

fn write_to<W: core::fmt::Write + ?Sized>(self: &Self, sink: &mut W) -> Result
fn writeable_length_hint(self: &Self) -> LengthHint

impl<T> Any for Other

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Other

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Other

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Other

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> ErasedDestructor for Other

impl<T> From for Other

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Other

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> ToString for Other

fn to_string(self: &Self) -> String

impl<T, U> Into for Other

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Other

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Other

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>