Struct glib::value::BoxedValue
source · pub struct BoxedValue(pub Value);
Tuple Fields§
§0: Value
Methods from Deref<Target = Value>§
pub fn as_ptr(&self) -> *mut GValue
sourcepub fn get<'a, T>(
&'a self,
) -> Result<T, <<T as FromValue<'_>>::Checker as ValueTypeChecker>::Error>where
T: FromValue<'a>,
pub fn get<'a, T>(
&'a self,
) -> Result<T, <<T as FromValue<'_>>::Checker as ValueTypeChecker>::Error>where
T: FromValue<'a>,
Tries to get a value of type T
.
Returns Ok
if the type is correct.
sourcepub fn get_owned<T>(
&self,
) -> Result<T, <<T as FromValue<'_>>::Checker as ValueTypeChecker>::Error>where
T: for<'b> FromValue<'b> + 'static,
pub fn get_owned<T>(
&self,
) -> Result<T, <<T as FromValue<'_>>::Checker as ValueTypeChecker>::Error>where
T: for<'b> FromValue<'b> + 'static,
Tries to get a value of an owned type T
.
sourcepub fn is<T: StaticType>(&self) -> bool
pub fn is<T: StaticType>(&self) -> bool
Returns true
if the type of the value corresponds to T
or is a sub-type of T
.
sourcepub fn is_type(&self, type_: Type) -> bool
pub fn is_type(&self, type_: Type) -> bool
Returns true
if the type of the value corresponds to type_
or is a sub-type of type_
.
sourcepub fn transform<T: ValueType>(&self) -> Result<Value, BoolError>
pub fn transform<T: ValueType>(&self) -> Result<Value, BoolError>
Tries to transform the value into a value of the target type
sourcepub fn transform_with_type(&self, type_: Type) -> Result<Value, BoolError>
pub fn transform_with_type(&self, type_: Type) -> Result<Value, BoolError>
Tries to transform the value into a value of the target type
fn content_debug_string(&self) -> GString
Trait Implementations§
source§impl Deref for BoxedValue
impl Deref for BoxedValue
source§impl From<BoxedValue> for Value
impl From<BoxedValue> for Value
source§fn from(v: BoxedValue) -> Self
fn from(v: BoxedValue) -> Self
Converts to this type from the input type.
source§impl<'a> FromValue<'a> for BoxedValue
impl<'a> FromValue<'a> for BoxedValue
source§type Checker = GenericValueTypeOrNoneChecker<BoxedValue>
type Checker = GenericValueTypeOrNoneChecker<BoxedValue>
Value type checker.
source§unsafe fn from_value(value: &'a Value) -> Self
unsafe fn from_value(value: &'a Value) -> Self
Get the contained value from a
Value
. Read moresource§impl StaticType for BoxedValue
impl StaticType for BoxedValue
source§fn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of
Self
.source§impl ToValue for BoxedValue
impl ToValue for BoxedValue
source§impl ToValueOptional for BoxedValue
impl ToValueOptional for BoxedValue
source§fn to_value_optional(s: Option<&Self>) -> Value
fn to_value_optional(s: Option<&Self>) -> Value
Convert an
Option
to a Value
.source§impl ValueType for BoxedValue
impl ValueType for BoxedValue
source§type Type = BoxedValue
type Type = BoxedValue
Type to get the
Type
from. Read moreimpl ValueTypeOptional for BoxedValue
Auto Trait Implementations§
impl Freeze for BoxedValue
impl RefUnwindSafe for BoxedValue
impl !Send for BoxedValue
impl !Sync for BoxedValue
impl Unpin for BoxedValue
impl UnwindSafe for BoxedValue
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
Mutably borrows from an owned value. Read more
source§impl<T> IntoClosureReturnValue for T
impl<T> IntoClosureReturnValue for T
fn into_closure_return_value(self) -> Option<Value>
source§impl<T> StaticTypeExt for Twhere
T: StaticType,
impl<T> StaticTypeExt for Twhere
T: StaticType,
source§fn ensure_type()
fn ensure_type()
Ensures that the type has been registered with the type system.