glib::value

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type Checker = CharTypeChecker

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type Checker = FlagsTypeChecker

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

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, 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.

Source§

type Checker = ValueTypeOrNoneChecker<T, C, E>

Source§

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

Implementors§

Source§

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

Source§

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

Source§

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

Source§

impl<'a> FromValue<'a> for NormalizeMode

Source§

impl<'a> FromValue<'a> for UnicodeBreakType

Source§

impl<'a> FromValue<'a> for UnicodeScript

Source§

impl<'a> FromValue<'a> for UnicodeType

Source§

impl<'a> FromValue<'a> for StrV

Source§

impl<'a> FromValue<'a> for BindingFlags

Source§

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

Source§

impl<'a> FromValue<'a> for IOCondition

Source§

impl<'a> FromValue<'a> for ILong

Source§

impl<'a> FromValue<'a> for ULong

Source§

impl<'a> FromValue<'a> for BoxedValue

Source§

impl<'a> FromValue<'a> for Value

Source§

impl<'a> FromValue<'a> for Pointer

Source§

impl<'a, 'input: 'a> FromValue<'a> for MatchInfo<'input>