Struct cursive_core::view::Margins
source · pub struct Margins {
pub left: usize,
pub right: usize,
pub top: usize,
pub bottom: usize,
}Expand description
Four values representing each direction.
Fields§
§left: usizeLeft margin
right: usizeRight margin
top: usizeTop margin
bottom: usizeBottom margin
Implementations§
source§impl Margins
impl Margins
sourcepub fn lrtb(left: usize, right: usize, top: usize, bottom: usize) -> Self
pub fn lrtb(left: usize, right: usize, top: usize, bottom: usize) -> Self
Creates a new Margins object from the Left, Right, Top, Bottom fields.
sourcepub fn ltrb(left_top: Vec2, right_bottom: Vec2) -> Self
pub fn ltrb(left_top: Vec2, right_bottom: Vec2) -> Self
Creates a new Margins object from the Left, Top, Right, Bottom fields.
sourcepub fn trbl(top: usize, right: usize, bottom: usize, left: usize) -> Self
pub fn trbl(top: usize, right: usize, bottom: usize, left: usize) -> Self
Creates a new Margins object from the Top, Right, Bottom, Left fields.
sourcepub fn lr(left: usize, right: usize) -> Self
pub fn lr(left: usize, right: usize) -> Self
Creates a new Margins object from the Left and Right fields.
Top and Bottom will be 0.
sourcepub fn tb(top: usize, bottom: usize) -> Self
pub fn tb(top: usize, bottom: usize) -> Self
Creates a new Margins object from the Top and Bottom fields.
Left and Right will be 0.
sourcepub fn horizontal(&self) -> usize
pub fn horizontal(&self) -> usize
Returns left + right.
Trait Implementations§
source§impl Resolvable for Margins
impl Resolvable for Margins
impl Copy for Margins
impl Eq for Margins
impl StructuralPartialEq for Margins
Auto Trait Implementations§
impl Freeze for Margins
impl RefUnwindSafe for Margins
impl Send for Margins
impl Sync for Margins
impl Unpin for Margins
impl UnwindSafe for Margins
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.