pub struct PlaceholderDimensions {
pub size: Size,
pub alignment: PlaceholderAlignment,
pub baseline_offset: Option<f64>,
pub baseline: Option<TextBaseline>,
}Expand description
Holds the Size and baseline required to represent the dimensions of a placeholder
in text.
Placeholders specify an empty space in the text layout, which is used to later render
arbitrary inline widgets into defined by a WidgetSpan.
Fields§
§size: SizeWidth and height dimensions of the placeholder.
alignment: PlaceholderAlignmentHow the placeholder vertically aligns with the text.
baseline_offset: Option<f64>Distance of the alignment from the top of the placeholder.
baseline: Option<TextBaseline>The TextBaseline to align against when using
PlaceholderAlignment::Baseline, AboveBaseline, and BelowBaseline.
Implementations§
Source§impl PlaceholderDimensions
impl PlaceholderDimensions
Sourcepub const EMPTY: PlaceholderDimensions
pub const EMPTY: PlaceholderDimensions
A constant representing an empty placeholder.
Sourcepub const fn new(
size: Size,
alignment: PlaceholderAlignment,
) -> PlaceholderDimensions
pub const fn new( size: Size, alignment: PlaceholderAlignment, ) -> PlaceholderDimensions
Constructs a PlaceholderDimensions object.
Trait Implementations§
Source§impl Clone for PlaceholderDimensions
impl Clone for PlaceholderDimensions
Source§fn clone(&self) -> PlaceholderDimensions
fn clone(&self) -> PlaceholderDimensions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PlaceholderDimensions
Source§impl Debug for PlaceholderDimensions
impl Debug for PlaceholderDimensions
Source§impl PartialEq for PlaceholderDimensions
impl PartialEq for PlaceholderDimensions
impl StructuralPartialEq for PlaceholderDimensions
Auto Trait Implementations§
impl Forget for PlaceholderDimensions
impl Freeze for PlaceholderDimensions
impl Move for PlaceholderDimensions
impl RefUnwindSafe for PlaceholderDimensions
impl Send for PlaceholderDimensions
impl Sync for PlaceholderDimensions
impl Unpin for PlaceholderDimensions
impl UnsafeUnpin for PlaceholderDimensions
impl UnwindSafe for PlaceholderDimensions
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