Struct style::logical_geometry::WritingMode
[−]
pub struct WritingMode { /* fields omitted */ }
Methods
impl WritingMode
pub const RTL: WritingMode
RTL: WritingMode = WritingMode{bits: 1 << 0,}
pub const VERTICAL: WritingMode
VERTICAL: WritingMode = WritingMode{bits: 1 << 1,}
pub const VERTICAL_LR: WritingMode
VERTICAL_LR: WritingMode = WritingMode{bits: 1 << 2,}
pub const LINE_INVERTED: WritingMode
LINE_INVERTED: WritingMode = WritingMode{bits: 1 << 3,}
For vertical writing modes only. When set, line-over/line-under sides are inverted from block-start/block-end. This flag is set when sideways-lr is used.
pub const SIDEWAYS: WritingMode
SIDEWAYS: WritingMode = WritingMode{bits: 1 << 4,}
pub const UPRIGHT: WritingMode
UPRIGHT: WritingMode = WritingMode{bits: 1 << 5,}
pub fn empty() -> WritingMode
Returns an empty set of flags.
pub fn all() -> WritingMode
Returns the set containing all flags.
pub fn bits(&self) -> u8
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u8) -> Option<WritingMode>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub fn from_bits_truncate(bits: u8) -> WritingMode
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
pub fn is_all(&self) -> bool
Returns true
if all flags are currently set.
pub fn intersects(&self, other: WritingMode) -> bool
Returns true
if there are flags common to both self
and other
.
pub fn contains(&self, other: WritingMode) -> bool
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: WritingMode)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: WritingMode)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: WritingMode)
Toggles the specified flags in-place.
pub fn set(&mut self, other: WritingMode, value: bool)
Inserts or removes the specified flags depending on the passed value.
impl WritingMode
[src]
pub fn new(inheritedbox_style: &InheritedBox) -> Self
[src]
Return a WritingMode bitflags from the relevant CSS properties.
pub fn is_vertical(&self) -> bool
[src]
pub fn is_vertical_lr(&self) -> bool
[src]
Assuming .is_vertical(), does the block direction go left to right?
pub fn is_inline_tb(&self) -> bool
[src]
Assuming .is_vertical(), does the inline direction go top to bottom?
pub fn is_bidi_ltr(&self) -> bool
[src]
pub fn is_sideways(&self) -> bool
[src]
pub fn is_upright(&self) -> bool
[src]
pub fn inline_start_physical_side(&self) -> PhysicalSide
[src]
pub fn inline_end_physical_side(&self) -> PhysicalSide
[src]
pub fn block_start_physical_side(&self) -> PhysicalSide
[src]
pub fn block_end_physical_side(&self) -> PhysicalSide
[src]
pub fn block_flow_direction(&self) -> BlockFlowDirection
[src]
pub fn inline_base_direction(&self) -> InlineBaseDirection
[src]
pub fn to_bidi_level(&self) -> Level
[src]
The default bidirectional embedding level for this writing mode.
Returns bidi level 0 if the mode is LTR, or 1 otherwise.
Trait Implementations
impl Copy for WritingMode
impl PartialEq for WritingMode
fn eq(&self, __arg_0: &WritingMode) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &WritingMode) -> bool
This method tests for !=
.
impl Eq for WritingMode
impl Clone for WritingMode
fn clone(&self) -> WritingMode
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialOrd for WritingMode
fn partial_cmp(&self, __arg_0: &WritingMode) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &WritingMode) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &WritingMode) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &WritingMode) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &WritingMode) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for WritingMode
fn cmp(&self, __arg_0: &WritingMode) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Hash for WritingMode
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl MallocSizeOf for WritingMode
[src]
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
[src]
Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more
impl Debug for WritingMode
impl Binary for WritingMode
impl Octal for WritingMode
impl LowerHex for WritingMode
impl UpperHex for WritingMode
impl BitOr for WritingMode
type Output = WritingMode
The resulting type after applying the |
operator.
fn bitor(self, other: WritingMode) -> WritingMode
Returns the union of the two sets of flags.
impl BitOrAssign for WritingMode
fn bitor_assign(&mut self, other: WritingMode)
Adds the set of flags.
impl BitXor for WritingMode
type Output = WritingMode
The resulting type after applying the ^
operator.
fn bitxor(self, other: WritingMode) -> WritingMode
Returns the left flags, but with all the right flags toggled.
impl BitXorAssign for WritingMode
fn bitxor_assign(&mut self, other: WritingMode)
Toggles the set of flags.
impl BitAnd for WritingMode
type Output = WritingMode
The resulting type after applying the &
operator.
fn bitand(self, other: WritingMode) -> WritingMode
Returns the intersection between the two sets of flags.
impl BitAndAssign for WritingMode
fn bitand_assign(&mut self, other: WritingMode)
Disables all flags disabled in the set.
impl Sub for WritingMode
type Output = WritingMode
The resulting type after applying the -
operator.
fn sub(self, other: WritingMode) -> WritingMode
Returns the set difference of the two sets of flags.
impl SubAssign for WritingMode
fn sub_assign(&mut self, other: WritingMode)
Disables all flags enabled in the set.
impl Not for WritingMode
type Output = WritingMode
The resulting type after applying the !
operator.
fn not(self) -> WritingMode
Returns the complement of this set of flags.
impl Extend<WritingMode> for WritingMode
fn extend<T: IntoIterator<Item = WritingMode>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
impl FromIterator<WritingMode> for WritingMode
fn from_iter<T: IntoIterator<Item = WritingMode>>(iterator: T) -> WritingMode
Creates a value from an iterator. Read more