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