[][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")
);

Implementations

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

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

Wraps view in a new PaddedView with the given margins.

pub fn lrtb(
    left: usize,
    right: usize,
    top: usize,
    bottom: usize,
    view: V
) -> PaddedView<V>
[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> ViewWrapper for PaddedView<V> where
    V: View
[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> AnyView for T where
    T: View
[src]

fn as_any(&self) -> &(dyn Any + 'static)[src]

Downcast self to a Any.

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)[src]

Downcast self to a mutable Any.

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

impl<T> Finder for T where
    T: View
[src]

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

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

impl<T> IntoBoxedView for T where
    T: View
[src]

impl<T> Nameable for T where
    T: View
[src]

impl<T> Resizable for T where
    T: View
[src]

impl<T> Scrollable for T where
    T: View
[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.

impl<T> View for T where
    T: ViewWrapper
[src]

impl<T> With for T[src]