[][src]Struct cursive::view::Margins

pub struct Margins {
    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 Margins[src]

pub fn new(left: usize, right: usize, top: usize, bottom: usize) -> Self[src]

Creates a new Margins.

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 Copy for Margins[src]

impl From<(usize, usize, usize, usize)> for Margins[src]

impl From<(i32, i32, i32, i32)> for Margins[src]

impl From<((i32, i32), (i32, i32))> for Margins[src]

impl From<((usize, usize), (usize, usize))> for Margins[src]

impl Clone for Margins[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Into<Margins>> Add<T> for Margins[src]

type Output = Margins

The resulting type after applying the + operator.

impl<T: Into<Margins>> Sub<T> for Margins[src]

type Output = Margins

The resulting type after applying the - operator.

impl Mul<usize> for Margins[src]

type Output = Margins

The resulting type after applying the * operator.

impl Div<usize> for Margins[src]

type Output = Margins

The resulting type after applying the / operator.

Auto Trait Implementations

impl Send for Margins

impl Sync for Margins

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]