Struct sourceview5::Encoding
source · pub struct Encoding { /* private fields */ }
Expand description
Character encoding.
The #GtkSourceEncoding boxed type represents a character encoding. It is used for example by #GtkSourceFile. Note that the text in GTK widgets is always encoded in UTF-8.
GLib type: Boxed type with copy-on-clone semantics.
Implementations§
source§impl Encoding
impl Encoding
sourcepub fn as_ptr(&self) -> *mut GtkSourceEncoding
pub fn as_ptr(&self) -> *mut GtkSourceEncoding
Return the inner pointer to the underlying C value.
sourcepub unsafe fn from_glib_ptr_borrow(ptr: &*mut GtkSourceEncoding) -> &Self
pub unsafe fn from_glib_ptr_borrow(ptr: &*mut GtkSourceEncoding) -> &Self
Borrows the underlying C value.
sourcepub unsafe fn from_glib_ptr_borrow_mut(
ptr: &mut *mut GtkSourceEncoding,
) -> &mut Self
pub unsafe fn from_glib_ptr_borrow_mut( ptr: &mut *mut GtkSourceEncoding, ) -> &mut Self
Borrows the underlying C value mutably.
source§impl Encoding
impl Encoding
sourcepub fn charset(&self) -> GString
pub fn charset(&self) -> GString
Gets the character set of the #GtkSourceEncoding, such as “UTF-8” or “ISO-8859-1”.
§Returns
the character set of the #GtkSourceEncoding.
sourcepub fn name(&self) -> GString
pub fn name(&self) -> GString
Gets the name of the #GtkSourceEncoding such as “Unicode” or “Western”.
§Returns
the name of the #GtkSourceEncoding.
sourcepub fn to_str(&self) -> GString
pub fn to_str(&self) -> GString
§Returns
a string representation. Free with g_free() when no longer needed.
sourcepub fn current() -> Encoding
pub fn current() -> Encoding
Gets the #GtkSourceEncoding for the current locale.
See also get_charset()
.
§Returns
the current locale encoding.
sourcepub fn default_candidates() -> Vec<Encoding>
pub fn default_candidates() -> Vec<Encoding>
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 g_slist_free().
sourcepub fn from_charset(charset: &str) -> Option<Encoding>
pub fn from_charset(charset: &str) -> Option<Encoding>
Trait Implementations§
source§impl HasParamSpec for Encoding
impl HasParamSpec for Encoding
source§impl Ord for Encoding
impl Ord for Encoding
source§impl PartialEq for Encoding
impl PartialEq for Encoding
source§impl PartialOrd for Encoding
impl PartialOrd for Encoding
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for Encoding
impl StaticType for Encoding
source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for Encoding
impl StructuralPartialEq for Encoding
Auto Trait Implementations§
impl Freeze for Encoding
impl RefUnwindSafe for Encoding
impl !Send for Encoding
impl !Sync for Encoding
impl Unpin for Encoding
impl UnwindSafe for Encoding
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)