[][src]Struct cursive::views::PaddedView

pub struct PaddedView<V> { /* fields omitted */ }

Adds padding to another view.

This view wraps another view and adds some padding.

The wrapped view will see a reduced space available.

Examples

// Adds 2 columns of padding to the left and to the right.
let view = PaddedView::lrtb(
    2,2,0,0, // Left, Right, Top, Bottom
    TextView::new("Padded text")
);

Methods

impl<V: View> PaddedView<V>[src]

pub fn new(margins: Margins, view: V) -> Self[src]

Wraps view in a new PaddedView with the given margins.

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

Wraps view in a new PaddedView with the given margins.

pub fn set_margins(&mut self, margins: Margins)[src]

Sets the margins for this view.

pub fn get_inner(&self) -> &V[src]

Gets access to the inner view.

pub fn get_inner_mut(&mut self) -> &mut V[src]

Gets mutable access to the inner view.

Trait Implementations

impl<V: View> ViewWrapper for PaddedView<V>[src]

type V = V

Type that this view wraps.

Auto Trait Implementations

impl<V> RefUnwindSafe for PaddedView<V> where
    V: RefUnwindSafe

impl<V> Send for PaddedView<V> where
    V: Send

impl<V> Sync for PaddedView<V> where
    V: Sync

impl<V> Unpin for PaddedView<V> where
    V: Unpin

impl<V> UnwindSafe for PaddedView<V> where
    V: UnwindSafe

Blanket Implementations

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

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

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

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.