#[repr(C)]pub struct SelfAlignment(pub AlignFlags);Expand description
The specified value of the {align,justify}-self properties.
https://drafts.csswg.org/css-align/#self-alignment https://drafts.csswg.org/css-align/#propdef-align-self
Tuple Fields§
§0: AlignFlagsImplementations§
Source§impl SelfAlignment
impl SelfAlignment
Sourcepub fn is_valid_on_both_axes(&self) -> bool
pub fn is_valid_on_both_axes(&self) -> bool
Returns whether this value is valid for both axis directions.
Sourcepub fn parse_block<'i, 't>(
_: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>>
pub fn parse_block<'i, 't>( _: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>
Parse self-alignment on the block axis (for align-self)
Sourcepub fn parse_inline<'i, 't>(
_: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>>
pub fn parse_inline<'i, 't>( _: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>
Parse self-alignment on the block axis (for align-self)
Sourcefn parse<'i, 't>(
input: &mut Parser<'i, 't>,
axis: AxisDirection,
) -> Result<Self, ParseError<'i>>
fn parse<'i, 't>( input: &mut Parser<'i, 't>, axis: AxisDirection, ) -> Result<Self, ParseError<'i>>
Parse a self-alignment value on one of the axes.
fn list_keywords(f: KeywordsCollectFn<'_>, axis: AxisDirection)
Sourcepub fn flip_position(self) -> Self
pub fn flip_position(self) -> Self
Performs a flip of the position, that is, for self-start we return self-end, for left we return right, etc.
Sourcepub fn with_value(self, value: AlignFlags) -> Self
pub fn with_value(self, value: AlignFlags) -> Self
Returns a fixed-up alignment value.
Methods from Deref<Target = AlignFlags>§
pub const AUTO: Self
pub const NORMAL: Self
pub const START: Self
pub const END: Self
pub const FLEX_START: Self
pub const FLEX_END: Self
pub const CENTER: Self
pub const LEFT: Self
pub const RIGHT: Self
pub const BASELINE: Self
pub const LAST_BASELINE: Self
pub const STRETCH: Self
pub const SELF_START: Self
pub const SELF_END: Self
pub const SPACE_BETWEEN: Self
pub const SPACE_AROUND: Self
pub const SPACE_EVENLY: Self
pub const ANCHOR_CENTER: Self
pub const LEGACY: Self
pub const SAFE: Self
pub const UNSAFE: Self
pub const FLAG_BITS: Self
Sourcepub fn bits(&self) -> u8
pub fn bits(&self) -> u8
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub fn intersects(&self, other: Self) -> bool
pub fn intersects(&self, other: Self) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub fn contains(&self, other: Self) -> bool
pub fn contains(&self, other: Self) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn iter(&self) -> Iter<AlignFlags>
pub fn iter(&self) -> Iter<AlignFlags>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub fn iter_names(&self) -> IterNames<AlignFlags>
pub fn iter_names(&self) -> IterNames<AlignFlags>
Yield a set of contained named flags values.
This method is like iter, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Sourcepub fn with_value(&self, value: AlignFlags) -> Self
pub fn with_value(&self, value: AlignFlags) -> Self
Returns an updated value with the same flags.
Trait Implementations§
Source§impl Clone for SelfAlignment
impl Clone for SelfAlignment
Source§fn clone(&self) -> SelfAlignment
fn clone(&self) -> SelfAlignment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SelfAlignment
impl Debug for SelfAlignment
Source§impl<'de> Deserialize<'de> for SelfAlignment
impl<'de> Deserialize<'de> for SelfAlignment
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>,
Source§impl MallocSizeOf for SelfAlignment
impl MallocSizeOf for SelfAlignment
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl PartialEq for SelfAlignment
impl PartialEq for SelfAlignment
Source§impl Serialize for SelfAlignment
impl Serialize for SelfAlignment
Source§impl SpecifiedValueInfo for SelfAlignment
impl SpecifiedValueInfo for SelfAlignment
Source§fn collect_completion_keywords(f: KeywordsCollectFn<'_>)
fn collect_completion_keywords(f: KeywordsCollectFn<'_>)
Source§const SUPPORTED_TYPES: u8 = 0u8
const SUPPORTED_TYPES: u8 = 0u8
Source§impl ToComputedValue for SelfAlignment
impl ToComputedValue for SelfAlignment
Source§type ComputedValue = SelfAlignment
type ComputedValue = SelfAlignment
Source§fn from_computed_value(from: &Self::ComputedValue) -> Self
fn from_computed_value(from: &Self::ComputedValue) -> Self
Source§fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
Context.Source§impl ToCss for SelfAlignment
impl ToCss for SelfAlignment
Source§fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
self in CSS syntax, writing to dest.Source§fn to_css_string(&self) -> String
fn to_css_string(&self) -> String
self in CSS syntax and return a string. Read moreSource§fn to_css_cssstring(&self) -> String
fn to_css_cssstring(&self) -> String
self in CSS syntax and return a CssString. Read moreSource§impl ToResolvedValue for SelfAlignment
impl ToResolvedValue for SelfAlignment
Source§type ResolvedValue = SelfAlignment
type ResolvedValue = SelfAlignment
Source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Source§impl ToShmem for SelfAlignment
impl ToShmem for SelfAlignment
Source§impl ToTyped for SelfAlignment
impl ToTyped for SelfAlignment
Source§fn to_typed(&self) -> Option<TypedValue>
fn to_typed(&self) -> Option<TypedValue>
Source§impl Deref for SelfAlignment
impl Deref for SelfAlignment
impl Copy for SelfAlignment
impl Eq for SelfAlignment
impl StructuralPartialEq for SelfAlignment
Auto Trait Implementations§
impl Freeze for SelfAlignment
impl RefUnwindSafe for SelfAlignment
impl Send for SelfAlignment
impl Sync for SelfAlignment
impl Unpin for SelfAlignment
impl UnwindSafe for SelfAlignment
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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