Struct gtk4::ExpressionWatch
source · [−]#[repr(transparent)]pub struct ExpressionWatch { /* private fields */ }
Expand description
An opaque structure representing a watched Expression
.
The contents of ExpressionWatch
should only be accessed through the
provided API.
Implementations
sourceimpl ExpressionWatch
impl ExpressionWatch
sourcepub fn evaluate(&self) -> Option<Value>
pub fn evaluate(&self) -> Option<Value>
Evaluates the watched expression and on success stores the result
in value
.
This is equivalent to calling Expression::evaluate()
with the
expression and this pointer originally used to create watch
.
value
an empty GValue
to be set
Returns
TRUE
if the expression could be evaluated and value
was set
sourcepub fn evaluate_as<V: for<'b> FromValue<'b> + 'static>(&self) -> Option<V>
pub fn evaluate_as<V: for<'b> FromValue<'b> + 'static>(&self) -> Option<V>
Similar to Self::evaluate
but panics if the value is of a different type.
sourcepub fn unwatch(&self)
pub fn unwatch(&self)
Stops watching an expression.
See Expression::watch()
for how the watch
was established.
Trait Implementations
sourceimpl Clone for ExpressionWatch
impl Clone for ExpressionWatch
sourceimpl Debug for ExpressionWatch
impl Debug for ExpressionWatch
sourceimpl Hash for ExpressionWatch
impl Hash for ExpressionWatch
sourceimpl Ord for ExpressionWatch
impl Ord for ExpressionWatch
sourcefn cmp(&self, other: &ExpressionWatch) -> Ordering
fn cmp(&self, other: &ExpressionWatch) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<ExpressionWatch> for ExpressionWatch
impl PartialEq<ExpressionWatch> for ExpressionWatch
sourcefn eq(&self, other: &ExpressionWatch) -> bool
fn eq(&self, other: &ExpressionWatch) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl PartialOrd<ExpressionWatch> for ExpressionWatch
impl PartialOrd<ExpressionWatch> for ExpressionWatch
sourcefn partial_cmp(&self, other: &ExpressionWatch) -> Option<Ordering>
fn partial_cmp(&self, other: &ExpressionWatch) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl StaticType for ExpressionWatch
impl StaticType for ExpressionWatch
sourcefn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of Self
.
impl Eq for ExpressionWatch
impl StructuralEq for ExpressionWatch
impl StructuralPartialEq for ExpressionWatch
Auto Trait Implementations
impl RefUnwindSafe for ExpressionWatch
impl !Send for ExpressionWatch
impl !Sync for ExpressionWatch
impl Unpin for ExpressionWatch
impl UnwindSafe for ExpressionWatch
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> StaticTypeExt for T where
T: StaticType,
impl<T> StaticTypeExt for T where
T: StaticType,
sourcefn ensure_type()
fn ensure_type()
Ensures that the type has been registered with the type system.