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§
impl Copy for Position
impl Eq for Position
impl StructuralEq for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
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
§impl<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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.