Struct BoxedValue
pub struct BoxedValue(pub Value);Tuple Fields§
§0: ValueMethods from Deref<Target = Value>§
pub fn as_ptr(&self) -> *mut GValue
pub fn get<'a, T>(
&'a self,
) -> Result<T, <<T as FromValue<'a>>::Checker as ValueTypeChecker>::Error>where
T: FromValue<'a>,
pub fn get<'a, T>(
&'a self,
) -> Result<T, <<T as FromValue<'a>>::Checker as ValueTypeChecker>::Error>where
T: FromValue<'a>,
Tries to get a value of type T.
Returns Ok if the type is correct.
pub 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.
pub fn is<T>(&self) -> boolwhere
T: StaticType,
pub fn is<T>(&self) -> boolwhere
T: StaticType,
Returns true if the type of the value corresponds to T
or is a sub-type of T.
pub 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_.
pub fn transform<T>(&self) -> Result<Value, BoolError>where
T: ValueType,
pub fn transform<T>(&self) -> Result<Value, BoolError>where
T: ValueType,
Tries to transform the value into a value of the target type
pub 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
Trait Implementations§
§impl Deref for BoxedValue
impl Deref for BoxedValue
§impl From<BoxedValue> for Value
impl From<BoxedValue> for Value
§fn from(v: BoxedValue) -> Value
fn from(v: BoxedValue) -> Value
Converts to this type from the input type.
§impl<'a> FromValue<'a> for BoxedValue
impl<'a> FromValue<'a> for BoxedValue
§type Checker = GenericValueTypeOrNoneChecker<BoxedValue>
type Checker = GenericValueTypeOrNoneChecker<BoxedValue>
Value type checker.
§unsafe fn from_value(value: &'a Value) -> BoxedValue
unsafe fn from_value(value: &'a Value) -> BoxedValue
Get the contained value from a
Value. Read more§impl StaticType for BoxedValue
impl StaticType for BoxedValue
§fn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of
Self.§impl ToValue for BoxedValue
impl ToValue for BoxedValue
§impl ToValueOptional for BoxedValue
impl ToValueOptional for BoxedValue
§fn to_value_optional(s: Option<&BoxedValue>) -> Value
fn to_value_optional(s: Option<&BoxedValue>) -> Value
Convert an
Option to a Value.§impl ValueType for BoxedValue
impl ValueType for BoxedValue
§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IntoClosureReturnValue for T
impl<T> IntoClosureReturnValue for T
fn into_closure_return_value(self) -> Option<Value>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> StaticTypeExt for Twhere
T: StaticType,
impl<T> StaticTypeExt for Twhere
T: StaticType,
§fn ensure_type()
fn ensure_type()
Ensures that the type has been registered with the type system.