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]
pub fn new(left: usize, right: usize, top: usize, bottom: usize) -> Self
[src]
Creates a new Vec4.
pub fn horizontal(&self) -> usize
[src]
Returns left + right.
pub fn vertical(&self) -> usize
[src]
Returns top + bottom.
pub fn combined(&self) -> Vec2
[src]
Returns (left+right, top+bottom).
pub fn top_left(&self) -> Vec2
[src]
Returns (left, top).
pub fn bot_right(&self) -> Vec2
[src]
Returns (right, bottom).
Trait Implementations
impl Clone for Vec4
[src]
fn clone(&self) -> Vec4
[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
impl Copy for Vec4
[src]
impl From<(usize, usize, usize, usize)> for Vec4
[src]
fn from((left, right, top, bottom): (usize, usize, usize, usize)) -> Vec4
[src]
Performs the conversion.
impl From<(i32, i32, i32, i32)> for Vec4
[src]
impl From<((i32, i32), (i32, i32))> for Vec4
[src]
fn from(((left, right), (top, bottom)): ((i32, i32), (i32, i32))) -> Vec4
[src]
Performs the conversion.
impl From<((usize, usize), (usize, usize))> for Vec4
[src]
fn from(
((left, right), (top, bottom)): ((usize, usize), (usize, usize))
) -> Vec4
[src]
((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
[src]
Performs the +
operation.
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
[src]
Performs the -
operation.
impl Div<usize> for Vec4
[src]
type Output = Vec4
The resulting type after applying the /
operator.
fn div(self, other: usize) -> Vec4
[src]
Performs the /
operation.