pub enum Position {
Relative,
Absolute,
}
Expand description
The positioning strategy for this item.
This controls both how the origin is determined for the Style::position
field,
and whether or not the item will be controlled by flexbox’s layout algorithm.
WARNING: this enum follows the behavior of CSS’s position
property,
which can be unintuitive.
Position::Relative
is the default value, in contrast to the default behavior in CSS.
Variants§
Relative
The offset is computed relative to the final position given by the layout algorithm. Offsets do not affect the position of any other items; they are effectively a correction factor applied at the end.
Absolute
The offset is computed relative to this item’s closest positioned ancestor, if any. Otherwise, it is placed relative to the origin. No space is created for the item in the page layout, and its size will not be altered.
WARNING: to opt-out of layouting entirely, you must use Display::None
instead on your Style
object.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Position
impl<'de> Deserialize<'de> for Position
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for Position
impl Eq for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnwindSafe for Position
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)