[−][src]Struct cursive::view::Margins
Four values representing each direction.
Fields
left: usize
Left margin
right: usize
Right margin
top: usize
Top margin
bottom: usize
Bottom margin
Implementations
impl Margins
[src]
pub fn new(left: usize, right: usize, top: usize, bottom: usize) -> Margins
[src]
Margins::new()
is ambiguous. Use Margins::lrtb()
instead.
Creates a new Margins.
pub fn zeroes() -> Margins
[src]
Creates a new Margins
object with zero margins.
pub fn lrtb(left: usize, right: usize, top: usize, bottom: usize) -> Margins
[src]
Creates a new Margins
object from the Left, Right, Top, Bottom fields.
pub fn ltrb(left_top: XY<usize>, right_bottom: XY<usize>) -> Margins
[src]
Creates a new Margins
object from the Left, Top, Right, Bottom fields.
pub fn trbl(top: usize, right: usize, bottom: usize, left: usize) -> Margins
[src]
Creates a new Margins
object from the Top, Right, Bottom, Left fields.
pub fn lr(left: usize, right: usize) -> Margins
[src]
Creates a new Margins
object from the Left and Right fields.
Top and Bottom will be 0.
pub fn tb(top: usize, bottom: usize) -> Margins
[src]
Creates a new Margins
object from the Top and Bottom fields.
Left and Right will be 0.
pub fn horizontal(&self) -> usize
[src]
Returns left + right.
pub fn vertical(&self) -> usize
[src]
Returns top + bottom.
pub fn combined(&self) -> XY<usize>
[src]
Returns (left+right, top+bottom).
pub fn top_left(&self) -> XY<usize>
[src]
Returns (left, top).
pub fn bot_right(&self) -> XY<usize>
[src]
Returns (right, bottom).
Trait Implementations
impl Add<Margins> for Margins
[src]
type Output = Margins
The resulting type after applying the +
operator.
pub fn add(self, other: Margins) -> Margins
[src]
impl Clone for Margins
[src]
impl Copy for Margins
[src]
impl Debug for Margins
[src]
impl Div<usize> for Margins
[src]
type Output = Margins
The resulting type after applying the /
operator.
pub fn div(self, other: usize) -> Margins
[src]
impl Eq for Margins
[src]
impl Hash for Margins
[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Mul<usize> for Margins
[src]
type Output = Margins
The resulting type after applying the *
operator.
pub fn mul(self, other: usize) -> Margins
[src]
impl PartialEq<Margins> for Margins
[src]
impl StructuralEq for Margins
[src]
impl StructuralPartialEq for Margins
[src]
impl Sub<Margins> for Margins
[src]
Auto Trait Implementations
impl RefUnwindSafe for Margins
[src]
impl Send for Margins
[src]
impl Sync for Margins
[src]
impl Unpin for Margins
[src]
impl UnwindSafe for Margins
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CallHasher for T where
T: Hash + ?Sized,
[src]
T: Hash + ?Sized,
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> With for T
[src]
pub fn wrap_with<U, F>(self, f: F) -> U where
F: FnOnce(Self) -> U,
[src]
F: FnOnce(Self) -> U,
pub fn with<F>(self, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),
pub fn try_with<E, F>(self, f: F) -> Result<Self, E> where
F: FnOnce(&mut Self) -> Result<(), E>,
[src]
F: FnOnce(&mut Self) -> Result<(), E>,
pub fn with_if<F>(self, condition: bool, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),