Enum cursive::view::SizeConstraint [] [src]

pub enum SizeConstraint {
    Free,
    Full,
    Fixed(usize),
    AtMost(usize),
    AtLeast(usize),
}

Single-dimensional constraint on a view size.

This describes a possible behaviour for a BoxView.

Variants

Free

No constraint imposed, the child view's response is used.

Full

Tries to take all available space, no matter what the child needs.

Fixed(usize)

Always return the included size, no matter what the child needs.

AtMost(usize)

Returns the minimum of the included value and the child view's size.

AtLeast(usize)

Returns the maximum of the included value and the child view's size.

Methods

impl SizeConstraint
[src]

fn available(self, available: usize) -> usize

Returns the size to be given to the child.

When available is offered to the BoxView.

fn result(self, (result, available): (usize, usize)) -> usize

Returns the size the child view should actually use.

When it said it wanted result.

Trait Implementations

impl Copy for SizeConstraint
[src]

impl Clone for SizeConstraint
[src]

fn clone(&self) -> SizeConstraint

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Debug for SizeConstraint
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.