Enum cursive::direction::Orientation
[−]
[src]
pub enum Orientation { Horizontal, Vertical, }
Describes a vertical or horizontal orientation for a view.
Variants
Horizontal
Horizontal orientation
Vertical
Vertical orientation
Methods
impl Orientation
[src]
fn get(&self, v: &Vec2) -> usize
Returns the component of v
corresponding to this orientation.
(Horizontal
will return the x value,
and Vertical
will return the y value.)
fn swap(&self) -> Self
Returns the other orientation.
fn get_ref<'a, 'b>(&'a self, v: &'b mut Vec2) -> &'b mut usize
Returns a mutable reference to the component of the given vector corresponding to this orientation.
fn stack<'a, T: Iterator<Item=&'a Vec2>>(&self, iter: T) -> Vec2
Takes an iterator on sizes, and stack them in the current orientation, returning the size of the required bounding box.
For an horizontal view, returns (Sum(x), Max(y)). For a vertical view, returns (Max(x),Sum(y)).
fn make_vec(&self, main_axis: usize, second_axis: usize) -> Vec2
Creates a new Vec2
with value
in self
's axis.
Trait Implementations
impl PartialEq for Orientation
[src]
fn eq(&self, __arg_0: &Orientation) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl Debug for Orientation
[src]
impl Copy for Orientation
[src]
impl Clone for Orientation
[src]
fn clone(&self) -> Orientation
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