Struct AlignItems
pub struct AlignItems {
pub keyword: AlignItemsKeyword,
pub safety: AlignmentSafety,
}Expand description
Used to control how child nodes are aligned. For Flexbox it controls alignment in the cross axis. For Grid it controls alignment in the block axis.
Fields§
§keyword: AlignItemsKeywordPosition keyword.
safety: AlignmentSafetyOverflow-position modifier (safe / unsafe).
Implementations§
§impl AlignItems
impl AlignItems
pub const NORMAL: AlignItems
pub const NORMAL: AlignItems
The layout mode’s default alignment. See [AlignItemsKeyword::Normal].
pub const START: AlignItems
pub const START: AlignItems
Items are packed toward the start of the axis.
pub const END: AlignItems
pub const END: AlignItems
Items are packed toward the end of the axis.
pub const FLEX_START: AlignItems
pub const FLEX_START: AlignItems
Items are packed towards the flex-relative start of the axis.
pub const FLEX_END: AlignItems
pub const FLEX_END: AlignItems
Items are packed towards the flex-relative end of the axis.
pub const SELF_START: AlignItems
pub const SELF_START: AlignItems
Items are packed toward the start of the axis as determined by the item’s own direction.
pub const SELF_END: AlignItems
pub const SELF_END: AlignItems
Items are packed toward the end of the axis as determined by the item’s own direction.
pub const CENTER: AlignItems
pub const CENTER: AlignItems
Items are packed along the center of the cross axis.
pub const BASELINE: AlignItems
pub const BASELINE: AlignItems
Items are aligned such as their baselines align.
pub const STRETCH: AlignItems
pub const STRETCH: AlignItems
Stretch to fill the container.
pub const SAFE_START: AlignItems
pub const SAFE_START: AlignItems
Like AlignItems::START, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
pub const SAFE_END: AlignItems
pub const SAFE_END: AlignItems
Like AlignItems::END, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
pub const SAFE_FLEX_START: AlignItems
pub const SAFE_FLEX_START: AlignItems
Like AlignItems::FLEX_START, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
pub const SAFE_FLEX_END: AlignItems
pub const SAFE_FLEX_END: AlignItems
Like AlignItems::FLEX_END, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
pub const SAFE_CENTER: AlignItems
pub const SAFE_CENTER: AlignItems
Like AlignItems::CENTER, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
pub const SAFE_SELF_START: AlignItems
pub const SAFE_SELF_START: AlignItems
Like AlignItems::SELF_START, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
pub const SAFE_SELF_END: AlignItems
pub const SAFE_SELF_END: AlignItems
Like AlignItems::SELF_END, but falls back to AlignItems::START when the
alignment subject overflows the alignment container, to avoid data loss.
pub const fn is_safe(self) -> bool
pub const fn is_safe(self) -> bool
Returns true iff this carries the safe overflow-position modifier.
pub const fn with_safety(self, safety: AlignmentSafety) -> AlignItems
pub const fn with_safety(self, safety: AlignmentSafety) -> AlignItems
Returns this alignment with the given overflow-position modifier.
pub const fn keyword(self) -> AlignItemsKeyword
pub const fn keyword(self) -> AlignItemsKeyword
Returns the underlying position keyword, discarding the safety modifier.
pub const fn is_stretch_or_normal(self) -> bool
pub const fn is_stretch_or_normal(self) -> bool
Returns true if the keyword is Stretch or Normal (ignoring any overflow-position
modifier).
pub fn resolve_self_relative(
self,
item_direction: Direction,
container_direction: Direction,
axis_is_inline: bool,
) -> AlignItems
pub fn resolve_self_relative( self, item_direction: Direction, container_direction: Direction, axis_is_inline: bool, ) -> AlignItems
Resolve the writing-mode-relative SelfStart/SelfEnd keywords to Start/End
based on the item’s own direction per CSS Box Alignment §5.2
https://www.w3.org/TR/css-align-3/#self-alignment. All other keywords are
returned unchanged.
The Start/End keywords used by the compute paths are relative to the
container’s writing mode/direction, so in the inline axis SelfStart resolves
to Start when the item’s direction matches the container’s and to End when it
differs. Taffy only supports the horizontal-tb writing mode, so in the block
axis SelfStart/SelfEnd always resolve to Start/End respectively.
Trait Implementations§
§impl Clone for AlignItems
impl Clone for AlignItems
§fn clone(&self) -> AlignItems
fn clone(&self) -> AlignItems
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AlignItems
§impl Debug for AlignItems
impl Debug for AlignItems
§impl Default for AlignItems
impl Default for AlignItems
§fn default() -> AlignItems
fn default() -> AlignItems
impl Eq for AlignItems
§impl PartialEq for AlignItems
impl PartialEq for AlignItems
impl StructuralPartialEq for AlignItems
Auto Trait Implementations§
impl Freeze for AlignItems
impl RefUnwindSafe for AlignItems
impl Send for AlignItems
impl Sync for AlignItems
impl Unpin for AlignItems
impl UnsafeUnpin for AlignItems
impl UnwindSafe for AlignItems
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DynEq for T
impl<T> DynEq for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Settings for T
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a [Template::Output].§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.§impl<T> TypeData for T
impl<T> TypeData for T
§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
self.