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 Copy for Vec4[src]
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 ToVec4 for Vec4[src]
impl<T: ToVec4> 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: ToVec4> 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