Struct swash::LocalizedString[][src]

pub struct LocalizedString<'a> { /* fields omitted */ }

Represents a single localized string in a font.

Localized strings contain an identifier that describes the content of the string (such as family name, copyright notice, sample text, etc), a language that specifies the audience for which the string is intended and some encoded data containing the value of the string. A string with a particular identifier can appear multiple times in a font with various languages and encodings.

Implementations

impl<'a> LocalizedString<'a>[src]

pub fn id(&self) -> StringId[src]

Returns the string identifier.

pub fn language(&self) -> &str[src]

Returns the language of the string.

pub fn is_unicode(&self) -> bool[src]

Returns true if the encoding for the string is unicode.

pub fn is_decodable(&self) -> bool[src]

Returns true if the string can be decoded.

pub fn chars(&self) -> Chars<'a>

Notable traits for Chars<'a>

impl<'a> Iterator for Chars<'a> type Item = char;
[src]

Returns an iterator over the sequence of characters representing the decoded string if the encoding is known. Will generate an empty string otherwise.

pub fn to_string(&self) -> String[src]

Converts the string to a standard string.

Trait Implementations

impl<'a> Clone for LocalizedString<'a>[src]

impl<'a> Copy for LocalizedString<'a>[src]

impl<'a> IntoIterator for LocalizedString<'a>[src]

type IntoIter = Chars<'a>

Which kind of iterator are we turning this into?

type Item = char

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> RefUnwindSafe for LocalizedString<'a>

impl<'a> Send for LocalizedString<'a>

impl<'a> Sync for LocalizedString<'a>

impl<'a> Unpin for LocalizedString<'a>

impl<'a> UnwindSafe for LocalizedString<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.