Struct sourceview5::Encoding[][src]

pub struct Encoding(_);

Implementations

impl Encoding[src]

pub fn get_charset(&self) -> Option<GString>[src]

Gets the character set of the Encoding, such as “UTF-8” or “ISO-8859-1”.

Returns

the character set of the Encoding.

pub fn get_name(&self) -> Option<GString>[src]

Gets the name of the Encoding such as “Unicode” or “Western”.

Returns

the name of the Encoding.

pub fn to_str(&self) -> GString[src]

pub fn get_all() -> Vec<Encoding>[src]

Gets all encodings.

Returns

a list of all Encoding’s. Free with glib::SList::free.

pub fn get_current() -> Option<Encoding>[src]

Gets the Encoding for the current locale. See also g_get_charset.

Returns

the current locale encoding.

pub fn get_default_candidates() -> Vec<Encoding>[src]

Gets the list of default candidate encodings to try when loading a file. See FileLoader::set_candidate_encodings.

This function returns a different list depending on the current locale (i.e. language, country and default encoding). The UTF-8 encoding and the current locale encoding are guaranteed to be present in the returned list.

Returns

the list of default candidate encodings. Free with glib::SList::free.

pub fn get_from_charset(charset: &str) -> Option<Encoding>[src]

Gets a Encoding from a character set such as “UTF-8” or “ISO-8859-1”.

charset

a character set.

Returns

the corresponding Encoding, or None if not found.

pub fn get_utf8() -> Option<Encoding>[src]

Returns

the UTF-8 encoding.

Trait Implementations

impl Clone for Encoding[src]

impl Debug for Encoding[src]

impl Display for Encoding[src]

impl Eq for Encoding[src]

impl Hash for Encoding[src]

impl Ord for Encoding[src]

impl PartialEq<Encoding> for Encoding[src]

impl PartialOrd<Encoding> for Encoding[src]

impl StaticType for Encoding[src]

impl StructuralEq for Encoding[src]

impl StructuralPartialEq for Encoding[src]

Auto Trait Implementations

impl RefUnwindSafe for Encoding

impl !Send for Encoding

impl !Sync for Encoding

impl Unpin for Encoding

impl UnwindSafe for Encoding

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> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

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.