Enum libgir::library::Type

source ·
pub enum Type {
Show 17 variants Basic(Basic), Alias(Alias), Enumeration(Enumeration), Bitfield(Bitfield), Record(Record), Union(Union), Function(Function), Interface(Interface), Class(Class), Custom(Custom), Array(TypeId), CArray(TypeId), FixedArray(TypeId, u16, Option<String>), PtrArray(TypeId), HashTable(TypeId, TypeId), List(TypeId), SList(TypeId),
}

Variants§

§

Basic(Basic)

§

Alias(Alias)

§

Enumeration(Enumeration)

§

Bitfield(Bitfield)

§

Record(Record)

§

Union(Union)

§

Function(Function)

§

Interface(Interface)

§

Class(Class)

§

Custom(Custom)

§

Array(TypeId)

§

CArray(TypeId)

§

FixedArray(TypeId, u16, Option<String>)

§

PtrArray(TypeId)

§

HashTable(TypeId, TypeId)

§

List(TypeId)

§

SList(TypeId)

Implementations§

source§

impl Type

source

pub fn get_name(&self) -> String

source

pub fn get_deprecated_version(&self) -> Option<Version>

source

pub fn get_glib_name(&self) -> Option<&str>

source

pub fn c_array( library: &mut Library, inner: TypeId, size: Option<u16>, c_type: Option<String>, ) -> TypeId

source

pub fn find_c_array( library: &Library, inner: TypeId, size: Option<u16>, ) -> TypeId

source

pub fn container( library: &mut Library, name: &str, inner: Vec<TypeId>, ) -> Option<TypeId>

source

pub fn function(library: &mut Library, func: Function) -> TypeId

source

pub fn union(library: &mut Library, u: Union, ns_id: u16) -> TypeId

source

pub fn record(library: &mut Library, r: Record, ns_id: u16) -> TypeId

source

pub fn functions(&self) -> &[Function]

source

pub fn is_basic(&self) -> bool

source

pub fn is_basic_type(&self, env: &Env) -> bool

If the type is an Alias containing a basic, it’ll return true (whereas is_basic won’t).

source

pub fn get_inner_type<'a>(&'a self, env: &'a Env) -> Option<(&'a Type, u16)>

source

pub fn is_function(&self) -> bool

source

pub fn is_class(&self) -> bool

source

pub fn is_interface(&self) -> bool

source

pub fn is_final_type(&self) -> bool

source

pub fn is_fundamental(&self) -> bool

source

pub fn is_abstract(&self) -> bool

source

pub fn is_enumeration(&self) -> bool

source

pub fn is_bitfield(&self) -> bool

source§

impl Type

source

pub fn visit_functions_mut<V: FunctionsMutVisitor>( &mut self, visitor: &mut V, ) -> bool

Trait Implementations§

source§

impl Debug for Type

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for Type

source§

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

Formats the value using the given formatter. Read more
source§

impl IsExternal for Type

source§

fn is_external(&self, lib: &Library) -> bool

source§

impl IsIncomplete for Type

source§

fn is_incomplete(&self, lib: &Library) -> bool

source§

impl PartialEq for Type

source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Type

source§

impl StructuralPartialEq for Type

Auto Trait Implementations§

§

impl Freeze for Type

§

impl RefUnwindSafe for Type

§

impl Send for Type

§

impl Sync for Type

§

impl Unpin for Type

§

impl UnwindSafe for Type

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> DerivesCopy for T
where T: IsIncomplete,

source§

fn derives_copy(&self, lib: &Library) -> bool

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.