Struct style::logical_geometry::LogicalPoint
source · pub struct LogicalPoint<T> {
pub i: T,
pub b: T,
debug_writing_mode: DebugWritingMode,
}
Expand description
A 2D point in flow-relative dimensions
Fields§
§i: T
inline-axis coordinate
b: T
block-axis coordinate
debug_writing_mode: DebugWritingMode
Implementations§
source§impl<T: Zero> LogicalPoint<T>
impl<T: Zero> LogicalPoint<T>
pub fn zero(mode: WritingMode) -> LogicalPoint<T>
source§impl<T: Copy> LogicalPoint<T>
impl<T: Copy> LogicalPoint<T>
pub fn new(mode: WritingMode, i: T, b: T) -> LogicalPoint<T>
source§impl<T: Copy + Sub<T, Output = T>> LogicalPoint<T>
impl<T: Copy + Sub<T, Output = T>> LogicalPoint<T>
pub fn from_physical( mode: WritingMode, point: Point2D<T>, container_size: Size2D<T>, ) -> LogicalPoint<T>
pub fn x(&self, mode: WritingMode, container_size: Size2D<T>) -> T
pub fn set_x(&mut self, mode: WritingMode, x: T, container_size: Size2D<T>)
pub fn y(&self, mode: WritingMode, container_size: Size2D<T>) -> T
pub fn set_y(&mut self, mode: WritingMode, y: T, container_size: Size2D<T>)
pub fn to_physical( &self, mode: WritingMode, container_size: Size2D<T>, ) -> Point2D<T>
pub fn convert( &self, mode_from: WritingMode, mode_to: WritingMode, container_size: Size2D<T>, ) -> LogicalPoint<T>
source§impl<T: Copy + Add<T, Output = T>> LogicalPoint<T>
impl<T: Copy + Add<T, Output = T>> LogicalPoint<T>
sourcepub fn add_point(&self, other: &LogicalPoint<T>) -> LogicalPoint<T>
pub fn add_point(&self, other: &LogicalPoint<T>) -> LogicalPoint<T>
This doesn’t really makes sense, but happens when dealing with multiple origins.
Trait Implementations§
source§impl<T: Copy + Add<T, Output = T>> Add<LogicalSize<T>> for LogicalPoint<T>
impl<T: Copy + Add<T, Output = T>> Add<LogicalSize<T>> for LogicalPoint<T>
source§type Output = LogicalPoint<T>
type Output = LogicalPoint<T>
The resulting type after applying the
+
operator.source§fn add(self, other: LogicalSize<T>) -> LogicalPoint<T>
fn add(self, other: LogicalSize<T>) -> LogicalPoint<T>
Performs the
+
operation. Read moresource§impl<T: Clone> Clone for LogicalPoint<T>
impl<T: Clone> Clone for LogicalPoint<T>
source§fn clone(&self) -> LogicalPoint<T>
fn clone(&self) -> LogicalPoint<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for LogicalPoint<T>
impl<T: Debug> Debug for LogicalPoint<T>
source§impl<T: PartialEq> PartialEq for LogicalPoint<T>
impl<T: PartialEq> PartialEq for LogicalPoint<T>
source§impl<T> Serialize for LogicalPoint<T>where
T: Serialize,
impl<T> Serialize for LogicalPoint<T>where
T: Serialize,
source§impl<T: Copy + Sub<T, Output = T>> Sub<LogicalSize<T>> for LogicalPoint<T>
impl<T: Copy + Sub<T, Output = T>> Sub<LogicalSize<T>> for LogicalPoint<T>
source§type Output = LogicalPoint<T>
type Output = LogicalPoint<T>
The resulting type after applying the
-
operator.source§fn sub(self, other: LogicalSize<T>) -> LogicalPoint<T>
fn sub(self, other: LogicalSize<T>) -> LogicalPoint<T>
Performs the
-
operation. Read moreimpl<T: Copy> Copy for LogicalPoint<T>
impl<T: Eq> Eq for LogicalPoint<T>
impl<T> StructuralPartialEq for LogicalPoint<T>
Auto Trait Implementations§
impl<T> Freeze for LogicalPoint<T>where
T: Freeze,
impl<T> RefUnwindSafe for LogicalPoint<T>where
T: RefUnwindSafe,
impl<T> Send for LogicalPoint<T>where
T: Send,
impl<T> Sync for LogicalPoint<T>where
T: Sync,
impl<T> Unpin for LogicalPoint<T>where
T: Unpin,
impl<T> UnwindSafe for LogicalPoint<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
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>
Converts
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>
Converts
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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert