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

A builder-pattern type to construct Constraint objects.

Implementations§

source§

impl ConstraintBuilder

source

pub fn new() -> Self

Create a new ConstraintBuilder.

source

pub fn build(self) -> Constraint

Build the Constraint.

source

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

The constant value to be added to the property::Constraint::source-attribute.

source

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

The multiplication factor to be applied to the property::Constraint::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 property::Constraint::target-attribute property of the target using the property::Constraint::source-attribute property of the source.

source

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

The attribute of the property::Constraint::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 property::Constraint::target-attribute property of the target using the property::Constraint::source-attribute property of the source widget.

source

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

The attribute of the property::Constraint::target set by the constraint.

Trait Implementations§

source§

impl Clone for ConstraintBuilder

source§

fn clone(&self) -> ConstraintBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for ConstraintBuilder

source§

fn default() -> ConstraintBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.