Struct cursive::vec::Vec4
[−]
[src]
pub struct Vec4 { pub left: usize, pub right: usize, pub top: usize, pub bottom: usize, }
Four values representing each direction.
Fields
left: usize
Left margin
right: usize
Right margin
top: usize
Top margin
bottom: usize
Bottom margin
Methods
impl Vec4
[src]
fn new(left: usize, right: usize, top: usize, bottom: usize) -> Self
Creates a new Vec4.
fn horizontal(&self) -> usize
Returns left + right.
fn vertical(&self) -> usize
Returns top + bottom.
fn combined(&self) -> Vec2
Returns (left+right, top+bottom).
fn top_left(&self) -> Vec2
Returns (left, top).
fn bot_right(&self) -> Vec2
Returns (right, bottom).
Trait Implementations
impl Clone for Vec4
[src]
fn clone(&self) -> Vec4
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 Copy for Vec4
[src]
impl From<(usize, usize, usize, usize)> for Vec4
[src]
impl From<(i32, i32, i32, i32)> for Vec4
[src]
impl From<((i32, i32), (i32, i32))> for Vec4
[src]
impl From<((usize, usize), (usize, usize))> for Vec4
[src]
fn from(
((left, right), (top, bottom)): ((usize, usize), (usize, usize))
) -> Vec4
((left, right), (top, bottom)): ((usize, usize), (usize, usize))
) -> Vec4
Performs the conversion.
impl<T: Into<Vec4>> Add<T> for Vec4
[src]
type Output = Vec4
The resulting type after applying the +
operator
fn add(self, other: T) -> Vec4
The method for the +
operator
impl<T: Into<Vec4>> Sub<T> for Vec4
[src]
type Output = Vec4
The resulting type after applying the -
operator
fn sub(self, other: T) -> Vec4
The method for the -
operator
impl Div<usize> for Vec4
[src]
type Output = Vec4
The resulting type after applying the /
operator
fn div(self, other: usize) -> Vec4
The method for the /
operator