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]
impl Orientation
pub fn pair() -> XY<Orientation>
[src]
pub fn pair() -> XY<Orientation>
Returns a XY(Horizontal, Vertical)
.
pub fn get<T: Clone>(self, v: &XY<T>) -> T
[src]
pub fn get<T: Clone>(self, v: &XY<T>) -> T
Returns the component of v
corresponding to this orientation.
(Horizontal
will return the x value,
and Vertical
will return the y value.)
pub fn swap(self) -> Self
[src]
pub fn swap(self) -> Self
Returns the other orientation.
ⓘImportant traits for &'a mut Rpub fn get_ref<T>(self, v: &mut XY<T>) -> &mut T
[src]
pub fn get_ref<T>(self, v: &mut XY<T>) -> &mut T
Returns a mutable reference to the component of the given vector corresponding to this orientation.
pub fn stack<'a, T: Iterator<Item = &'a Vec2>>(self, iter: T) -> Vec2
[src]
pub 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)).
pub fn make_vec(self, main_axis: usize, second_axis: usize) -> Vec2
[src]
pub fn make_vec(self, main_axis: usize, second_axis: usize) -> Vec2
Creates a new Vec2
with value
in self
's axis.
Trait Implementations
impl Clone for Orientation
[src]
impl Clone for Orientation
fn clone(&self) -> Orientation
[src]
fn clone(&self) -> Orientation
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for Orientation
[src]
impl Copy for Orientation
impl Debug for Orientation
[src]
impl Debug for Orientation
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Orientation
[src]
impl PartialEq for Orientation
Auto Trait Implementations
impl Send for Orientation
impl Send for Orientation
impl Sync for Orientation
impl Sync for Orientation