pub enum UnresolvedMargin {
Zero,
Auto,
Length(PixelValue),
}Expand description
An unresolved CSS margin value.
Margins can be auto (for centering) or a length value that needs
resolution against the containing block.
Variants§
Zero
margin: 0 (default)
Auto
margin: auto (for centering, CSS 2.2 § 10.3.3)
Length(PixelValue)
A length value (px, %, em, vh, etc.)
Implementations§
Source§impl UnresolvedMargin
impl UnresolvedMargin
Sourcepub fn resolve(&self, ctx: &ResolutionContext) -> f32
pub fn resolve(&self, ctx: &ResolutionContext) -> f32
Resolve this margin value to pixels.
Autoreturns 0.0 (actual auto margin calculation happens in layout)Zeroreturns 0.0Lengthis resolved using the resolution context
Trait Implementations§
Source§impl Clone for UnresolvedMargin
impl Clone for UnresolvedMargin
Source§fn clone(&self) -> UnresolvedMargin
fn clone(&self) -> UnresolvedMargin
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnresolvedMargin
impl Debug for UnresolvedMargin
Source§impl Default for UnresolvedMargin
impl Default for UnresolvedMargin
Source§fn default() -> UnresolvedMargin
fn default() -> UnresolvedMargin
Returns the “default value” for a type. Read more
Source§impl PartialEq for UnresolvedMargin
impl PartialEq for UnresolvedMargin
impl Copy for UnresolvedMargin
impl StructuralPartialEq for UnresolvedMargin
Auto Trait Implementations§
impl Freeze for UnresolvedMargin
impl RefUnwindSafe for UnresolvedMargin
impl Send for UnresolvedMargin
impl Sync for UnresolvedMargin
impl Unpin for UnresolvedMargin
impl UnsafeUnpin for UnresolvedMargin
impl UnwindSafe for UnresolvedMargin
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more