Struct style::logical_geometry::LogicalMargin
[−]
[src]
pub struct LogicalMargin<T> { pub block_start: T, pub inline_end: T, pub block_end: T, pub inline_start: T, // some fields omitted }
A "margin" in flow-relative dimensions Represents the four sides of the margins, borders, or padding of a CSS box, or a combination of those. A positive "margin" can be added to a rectangle to obtain a bigger rectangle.
Fields
block_start: T
inline_end: T
block_end: T
inline_start: T
Methods
impl<T: Zero> LogicalMargin<T>
[src]
pub fn zero(mode: WritingMode) -> LogicalMargin<T>
[src]
impl<T: Copy> LogicalMargin<T>
[src]
pub fn new(
mode: WritingMode,
block_start: T,
inline_end: T,
block_end: T,
inline_start: T
) -> LogicalMargin<T>
[src]
mode: WritingMode,
block_start: T,
inline_end: T,
block_end: T,
inline_start: T
) -> LogicalMargin<T>
pub fn new_all_same(mode: WritingMode, value: T) -> LogicalMargin<T>
[src]
pub fn from_physical(
mode: WritingMode,
offsets: SideOffsets2D<T>
) -> LogicalMargin<T>
[src]
mode: WritingMode,
offsets: SideOffsets2D<T>
) -> LogicalMargin<T>
pub fn top(&self, mode: WritingMode) -> T
[src]
pub fn set_top(&mut self, mode: WritingMode, top: T)
[src]
pub fn right(&self, mode: WritingMode) -> T
[src]
pub fn set_right(&mut self, mode: WritingMode, right: T)
[src]
pub fn bottom(&self, mode: WritingMode) -> T
[src]
pub fn set_bottom(&mut self, mode: WritingMode, bottom: T)
[src]
pub fn left(&self, mode: WritingMode) -> T
[src]
pub fn set_left(&mut self, mode: WritingMode, left: T)
[src]
pub fn to_physical(&self, mode: WritingMode) -> SideOffsets2D<T>
[src]
pub fn convert(
&self,
mode_from: WritingMode,
mode_to: WritingMode
) -> LogicalMargin<T>
[src]
&self,
mode_from: WritingMode,
mode_to: WritingMode
) -> LogicalMargin<T>
impl<T: PartialEq + Zero> LogicalMargin<T>
[src]
impl<T: Copy + Add<T, Output = T>> LogicalMargin<T>
[src]
pub fn inline_start_end(&self) -> T
[src]
pub fn block_start_end(&self) -> T
[src]
pub fn start_end(&self, direction: Direction) -> T
[src]
pub fn top_bottom(&self, mode: WritingMode) -> T
[src]
pub fn left_right(&self, mode: WritingMode) -> T
[src]
Trait Implementations
impl<T: Clone> Clone for LogicalMargin<T>
[src]
fn clone(&self) -> LogicalMargin<T>
[src]
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<T: Copy> Copy for LogicalMargin<T>
[src]
impl<T: Eq> Eq for LogicalMargin<T>
[src]
impl<T: PartialEq> PartialEq for LogicalMargin<T>
[src]
fn eq(&self, __arg_0: &LogicalMargin<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &LogicalMargin<T>) -> bool
[src]
This method tests for !=
.
impl<T: Debug> Debug for LogicalMargin<T>
[src]
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl<T: Add<T, Output = T>> Add for LogicalMargin<T>
[src]
type Output = LogicalMargin<T>
The resulting type after applying the +
operator.
fn add(self, other: LogicalMargin<T>) -> LogicalMargin<T>
[src]
Performs the +
operation.
impl<T: Sub<T, Output = T>> Sub for LogicalMargin<T>
[src]
type Output = LogicalMargin<T>
The resulting type after applying the -
operator.
fn sub(self, other: LogicalMargin<T>) -> LogicalMargin<T>
[src]
Performs the -
operation.
impl<T: Copy + Add<T, Output = T> + Sub<T, Output = T>> Add<LogicalMargin<T>> for LogicalRect<T>
[src]
type Output = LogicalRect<T>
The resulting type after applying the +
operator.
fn add(self, other: LogicalMargin<T>) -> LogicalRect<T>
[src]
Performs the +
operation.
impl<T: Copy + Add<T, Output = T> + Sub<T, Output = T>> Sub<LogicalMargin<T>> for LogicalRect<T>
[src]
type Output = LogicalRect<T>
The resulting type after applying the -
operator.
fn sub(self, other: LogicalMargin<T>) -> LogicalRect<T>
[src]
Performs the -
operation.