Struct gtk4::builders::ConstraintBuilder

source ·
pub struct ConstraintBuilder { /* private fields */ }
Expand description

A builder-pattern type to construct Constraint objects.

Implementations§

source§

impl ConstraintBuilder

source

pub fn constant(self, constant: f64) -> Self

The constant value to be added to the source-attribute.

source

pub fn multiplier(self, multiplier: f64) -> Self

The multiplication factor to be applied to the source-attribute.

source

pub fn relation(self, relation: ConstraintRelation) -> Self

The order relation between the terms of the constraint.

source

pub fn source(self, source: &impl IsA<ConstraintTarget>) -> Self

The source of the constraint.

The constraint will set the target-attribute property of the target using the source-attribute property of the source.

source

pub fn source_attribute(self, source_attribute: ConstraintAttribute) -> Self

The attribute of the source read by the constraint.

source

pub fn strength(self, strength: i32) -> Self

The strength of the constraint.

The strength can be expressed either using one of the symbolic values of the ConstraintStrength enumeration, or any positive integer value.

source

pub fn target(self, target: &impl IsA<ConstraintTarget>) -> Self

The target of the constraint.

The constraint will set the target-attribute property of the target using the source-attribute property of the source widget.

source

pub fn target_attribute(self, target_attribute: ConstraintAttribute) -> Self

The attribute of the target set by the constraint.

source

pub fn build(self) -> Constraint

Build the Constraint.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.