pub struct PaddingElement { /* private fields */ }Expand description
Element that insets its content: a plain element, which a chain keeps as words.
Implementations§
Source§impl PaddingElement
impl PaddingElement
Sourcepub fn new(padding: EdgeInsets) -> Self
pub fn new(padding: EdgeInsets) -> Self
Creates an element that pads its content by padding, in logical pixels.
Sourcepub fn padding(&self) -> EdgeInsets
pub fn padding(&self) -> EdgeInsets
Returns the padding on each edge, in logical pixels.
Trait Implementations§
Source§impl Clone for PaddingElement
impl Clone for PaddingElement
Source§impl Debug for PaddingElement
impl Debug for PaddingElement
Source§impl PartialEq for PaddingElement
impl PartialEq for PaddingElement
Source§impl PlainElement for PaddingElement
impl PlainElement for PaddingElement
Source§const WORDS: usize = 5
const WORDS: usize = 5
How many words the value takes: at most
PLAIN_WORDS_MAX.Source§const CAPABILITIES: NodeCapabilities = NodeCapabilities::LAYOUT
const CAPABILITIES: NodeCapabilities = NodeCapabilities::LAYOUT
What the element takes part in: layout, draw or both.
Source§const LAYOUT: Option<&'static PlainLayoutFns>
const LAYOUT: Option<&'static PlainLayoutFns>
How the element measures the content it wraps, for an element with
NodeCapabilities::LAYOUT: Some(&PlainLayoutFns::of::<Self>())
for a PlainLayout. None, the default, passes the content’s
measure through.Source§fn to_words(&self, words: &mut [u32])
fn to_words(&self, words: &mut [u32])
Writes the value into
words, which holds Self::WORDS words.Source§fn from_words(words: &[u32]) -> Self
fn from_words(words: &[u32]) -> Self
The value that
Self::to_words wrote into words.Source§const UPDATE_INVALIDATION: Option<InvalidationKind> = None
const UPDATE_INVALIDATION: Option<InvalidationKind> = None
The one pipeline stage a changed value invalidates, or
None to
invalidate every stage of Self::CAPABILITIES.Source§fn inspector_name(&self) -> &'static str
fn inspector_name(&self) -> &'static str
Human readable name surfaced to inspector tooling.
Source§impl PlainLayout for PaddingElement
impl PlainLayout for PaddingElement
Source§const PREPARES: bool = true
const PREPARES: bool = true
Whether
Self::prepared changes the element: false, the
default, lets a coordinator copy the words as they are.Source§fn prepared(self, at: PrepareAt) -> Self
fn prepared(self, at: PrepareAt) -> Self
The element as a coordinator keeps it for the measures
at tells:
an element that rounds its values to device pixels, or mirrors them
for a layout direction, may do so here once, and measure from those
values. The default is the element itself.Source§fn measure_hold(
&self,
density: f32,
_constraints: Constraints,
size: Size,
wrapped: WrappedHold,
) -> Option<ConstraintsHold>
fn measure_hold( &self, density: f32, _constraints: Constraints, size: Size, wrapped: WrappedHold, ) -> Option<ConstraintsHold>
The incoming constraints the last measure, which gave
size under
constraints, holds for; see
super::super::LayoutModifierNode::measure_hold.Source§fn measure(
&self,
context: &mut dyn ModifierNodeContext,
measurable: &dyn Measurable,
constraints: Constraints,
) -> LayoutModifierMeasureResult
fn measure( &self, context: &mut dyn ModifierNodeContext, measurable: &dyn Measurable, constraints: Constraints, ) -> LayoutModifierMeasureResult
Measures the wrapped content under
constraints and returns the size
the element takes and where it places the content.Source§fn intrinsic(
&self,
measurable: &dyn Measurable,
kind: PlainIntrinsic,
density: f32,
) -> f32
fn intrinsic( &self, measurable: &dyn Measurable, kind: PlainIntrinsic, density: f32, ) -> f32
The intrinsic size
kind names: the wrapped content’s by default,
for an element that keeps the content’s size.impl StructuralPartialEq for PaddingElement
Auto Trait Implementations§
impl Forget for PaddingElement
impl Freeze for PaddingElement
impl Move for PaddingElement
impl RefUnwindSafe for PaddingElement
impl Send for PaddingElement
impl Sync for PaddingElement
impl Unpin for PaddingElement
impl UnsafeUnpin for PaddingElement
impl UnwindSafe for PaddingElement
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<T> ErasedDestructor for Twhere
T: 'static,
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