Struct LogicalInsets
pub struct LogicalInsets<P> {
pub top: P,
pub left: P,
pub bottom: P,
pub right: P,
}
Expand description
The logical distance between the edges of two rectangles.
Fields§
§top: P
The distance to the top edge.
left: P
The distance to the left edge.
bottom: P
The distance to the bottom edge.
right: P
The distance to the right edge.
Implementations§
§impl<P> LogicalInsets<P>
impl<P> LogicalInsets<P>
pub const fn new(top: P, left: P, bottom: P, right: P) -> LogicalInsets<P>
§impl<P> LogicalInsets<P>where
P: Pixel,
impl<P> LogicalInsets<P>where
P: Pixel,
pub fn from_physical<T, X>(physical: T, scale_factor: f64) -> LogicalInsets<P>
pub fn to_physical<X>(&self, scale_factor: f64) -> PhysicalInsets<X>where
X: Pixel,
pub fn cast<X>(&self) -> LogicalInsets<X>where
X: Pixel,
Trait Implementations§
§impl<P> Clone for LogicalInsets<P>where
P: Clone,
impl<P> Clone for LogicalInsets<P>where
P: Clone,
§fn clone(&self) -> LogicalInsets<P>
fn clone(&self) -> LogicalInsets<P>
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 more§impl<P> Debug for LogicalInsets<P>where
P: Debug,
impl<P> Debug for LogicalInsets<P>where
P: Debug,
§impl<P> Default for LogicalInsets<P>where
P: Default,
impl<P> Default for LogicalInsets<P>where
P: Default,
§fn default() -> LogicalInsets<P>
fn default() -> LogicalInsets<P>
Returns the “default value” for a type. Read more
§impl<P> From<LogicalInsets<P>> for Insetswhere
P: Pixel,
impl<P> From<LogicalInsets<P>> for Insetswhere
P: Pixel,
§fn from(insets: LogicalInsets<P>) -> Insets
fn from(insets: LogicalInsets<P>) -> Insets
Converts to this type from the input type.
§impl<P> Hash for LogicalInsets<P>where
P: Hash,
impl<P> Hash for LogicalInsets<P>where
P: Hash,
§impl<P> Ord for LogicalInsets<P>where
P: Ord,
impl<P> Ord for LogicalInsets<P>where
P: Ord,
§fn cmp(&self, other: &LogicalInsets<P>) -> Ordering
fn cmp(&self, other: &LogicalInsets<P>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
§impl<P> PartialEq for LogicalInsets<P>where
P: PartialEq,
impl<P> PartialEq for LogicalInsets<P>where
P: PartialEq,
§impl<P> PartialOrd for LogicalInsets<P>where
P: PartialOrd,
impl<P> PartialOrd for LogicalInsets<P>where
P: PartialOrd,
impl<P> Copy for LogicalInsets<P>where
P: Copy,
impl<P> Eq for LogicalInsets<P>where
P: Eq,
impl<P> StructuralPartialEq for LogicalInsets<P>
Auto Trait Implementations§
impl<P> Freeze for LogicalInsets<P>where
P: Freeze,
impl<P> RefUnwindSafe for LogicalInsets<P>where
P: RefUnwindSafe,
impl<P> Send for LogicalInsets<P>where
P: Send,
impl<P> Sync for LogicalInsets<P>where
P: Sync,
impl<P> Unpin for LogicalInsets<P>where
P: Unpin,
impl<P> UnwindSafe for LogicalInsets<P>where
P: 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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync 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
Checks if this value is equivalent to the given key. Read more
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key
and return true
if they are equal.§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
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 more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.