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<T: Clone>(&self, v: &XY<T>) -> T
[src]
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
[src]
Returns the other orientation.
fn get_ref<'a, 'b, T>(&'a self, v: &'b mut XY<T>) -> &'b mut T
[src]
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
[src]
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
[src]
Creates a new Vec2
with value
in self
's axis.
Trait Implementations
impl Clone for Orientation
[src]
fn clone(&self) -> Orientation
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more