Trait glib::value::FromValue

source ·
pub unsafe trait FromValue<'a>: Sized {
    type Checker: ValueTypeChecker;

    // Required method
    unsafe fn from_value(value: &'a Value) -> Self;
}
Expand description

Trait to retrieve the contained value from a Value.

Usually this would not be used directly but from the get function on a Value

Required Associated Types§

source

type Checker: ValueTypeChecker

Value type checker.

Required Methods§

source

unsafe fn from_value(value: &'a Value) -> Self

Get the contained value from a Value.

Safety

Self::Checker::check() must be called first and must not fail.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a> FromValue<'a> for &'a str

§

type Checker = GenericValueTypeOrNoneChecker<&'a str>

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a> FromValue<'a> for &'a [GStringPtr]

§

type Checker = GenericValueTypeChecker<&'a [GStringPtr]>

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a> FromValue<'a> for bool

§

type Checker = GenericValueTypeChecker<bool>

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a> FromValue<'a> for char

§

type Checker = CharTypeChecker

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a> FromValue<'a> for f32

§

type Checker = GenericValueTypeChecker<f32>

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a> FromValue<'a> for f64

§

type Checker = GenericValueTypeChecker<f64>

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a> FromValue<'a> for i8

§

type Checker = GenericValueTypeChecker<i8>

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a> FromValue<'a> for i32

§

type Checker = GenericValueTypeChecker<i32>

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a> FromValue<'a> for i64

§

type Checker = GenericValueTypeChecker<i64>

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a> FromValue<'a> for u8

§

type Checker = GenericValueTypeChecker<u8>

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a> FromValue<'a> for u32

§

type Checker = GenericValueTypeChecker<u32>

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a> FromValue<'a> for u64

§

type Checker = GenericValueTypeChecker<u64>

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a> FromValue<'a> for Box<str>

source§

impl<'a> FromValue<'a> for String

source§

impl<'a> FromValue<'a> for Vec<GString>

source§

impl<'a> FromValue<'a> for Vec<String>

§

type Checker = GenericValueTypeChecker<Vec<String>>

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a> FromValue<'a> for NonZeroI8

source§

impl<'a> FromValue<'a> for NonZeroI32

source§

impl<'a> FromValue<'a> for NonZeroI64

source§

impl<'a> FromValue<'a> for NonZeroU8

source§

impl<'a> FromValue<'a> for NonZeroU32

source§

impl<'a> FromValue<'a> for NonZeroU64

source§

impl<'a> FromValue<'a> for NonNull<Pointee>

source§

impl<'a> FromValue<'a> for PathBuf

source§

impl<'a, 'b> FromValue<'a> for Vec<&'b FlagsValue>

§

type Checker = FlagsTypeChecker

source§

unsafe fn from_value(value: &'a Value) -> Self

source§

impl<'a, T, C, E> FromValue<'a> for Option<T>
where T: FromValue<'a, Checker = C> + StaticType, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + Sized + 'static,

Blanket implementation for all optional types.

§

type Checker = ValueTypeOrNoneChecker<T, C, E>

source§

unsafe fn from_value(value: &'a Value) -> Self

Implementors§