Struct css_style::margin::Margin[][src]

pub struct Margin {
    pub top: Option<Length>,
    pub right: Option<Length>,
    pub bottom: Option<Length>,
    pub left: Option<Length>,
}
use css_style::{css, Style, unit::px};

Style::default()
    .and_margin(|conf| {
        conf.x(css::Auto) // equal to conf.left(css::Auto).right(css::Auto)
            .y(px(4))
    });

Fields

top: Option<Length>right: Option<Length>bottom: Option<Length>left: Option<Length>

Implementations

impl Margin[src]

pub fn top(self, value: impl Into<Length>) -> Self[src]

pub fn try_top(self, value: Option<impl Into<Length>>) -> Self[src]

pub fn right(self, value: impl Into<Length>) -> Self[src]

pub fn try_right(self, value: Option<impl Into<Length>>) -> Self[src]

pub fn bottom(self, value: impl Into<Length>) -> Self[src]

pub fn try_bottom(self, value: Option<impl Into<Length>>) -> Self[src]

pub fn left(self, value: impl Into<Length>) -> Self[src]

pub fn try_left(self, value: Option<impl Into<Length>>) -> Self[src]

impl Margin[src]

pub fn all(self, value: impl Into<Length>) -> Self[src]

pub fn zero(self) -> Self[src]

pub fn x(self, value: impl Into<Length>) -> Self[src]

pub fn y(self, value: impl Into<Length>) -> Self[src]

pub fn horizontal(self, value: impl Into<Length>) -> Self[src]

pub fn vertical(self, value: impl Into<Length>) -> Self[src]

pub fn auto(self) -> Self[src]

pub fn full(self) -> Self[src]

pub fn half(self) -> Self[src]

Trait Implementations

impl Clone for Margin[src]

impl Debug for Margin[src]

impl Default for Margin[src]

impl From<(Option<Length>, Option<Length>, Option<Length>, Option<Length>)> for Margin[src]

impl From<Auto> for Margin[src]

impl From<Length> for Margin[src]

impl From<Length> for Margin[src]

impl From<Percent> for Margin[src]

impl PartialEq<Margin> for Margin[src]

impl StructuralPartialEq for Margin[src]

impl StyleUpdater for Margin[src]

Auto Trait Implementations

impl RefUnwindSafe for Margin

impl Send for Margin

impl Sync for Margin

impl Unpin for Margin

impl UnwindSafe for Margin

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    T: Component + Float,
    D: AdaptFrom<S, Swp, Dwp, T>,
    Swp: WhitePoint,
    Dwp: WhitePoint
[src]

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, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.