Expand description
Margin sizes
Used by the layout system for margins around child widgets. Margins may be drawn in and handle events like any other widget area.
Fields
horiz: (u16, u16)Size of horizontal margins
vert: (u16, u16)Size of vertical margins
Implementations
sourceimpl Margins
impl Margins
sourcepub const fn hv(horiz: (u16, u16), vert: (u16, u16)) -> Self
pub const fn hv(horiz: (u16, u16), vert: (u16, u16)) -> Self
Margins via horizontal and vertical sizes
sourcepub fn extract<D: Directional>(self, dir: D) -> (u16, u16)
pub fn extract<D: Directional>(self, dir: D) -> (u16, u16)
Extract one component, based on a direction
This merely extracts the horizontal or vertical component. It never negates it, even if the axis is reversed.
Trait Implementations
sourceimpl PartialEq<Margins> for Margins
impl PartialEq<Margins> for Margins
impl Copy for Margins
impl Eq for Margins
impl StructuralEq for Margins
impl StructuralPartialEq for Margins
Auto Trait Implementations
impl RefUnwindSafe for Margins
impl Send for Margins
impl Sync for Margins
impl Unpin for Margins
impl UnwindSafe for Margins
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
sourcefn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Try approximate conversion from Self to T Read more
sourcefn cast_approx(self) -> T
fn cast_approx(self) -> T
Cast approximately from Self to T Read more
sourceimpl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
sourcefn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
sourcefn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
sourcefn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more
sourcefn try_cast_trunc(self) -> Result<T, Error>
fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
sourcefn try_cast_nearest(self) -> Result<T, Error>
fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
sourcefn try_cast_floor(self) -> Result<T, Error>
fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
sourcefn try_cast_ceil(self) -> Result<T, Error>
fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.