Struct ParagraphBox
pub struct ParagraphBox {
pub width: f32,
pub glue_before: f32,
pub stretch_before: f32,
pub shrink_before: f32,
pub break_before: bool,
pub break_penalty: i32,
pub flagged_break: bool,
pub break_width: f32,
pub end_protrusion: f32,
}Expand description
One shaped box in logical order. A box is usually a word or an unbreakable inline fragment; callers retain the actual glyph/style data separately.
Fields§
§width: f32Natural shaped advance of this fragment.
glue_before: f32Natural glue before this fragment. It is ignored when the fragment is first on a line.
stretch_before: f32Additional stretch capacity at this boundary. Zero derives capacity from natural glue; a positive value supports script-specific expansion such as spacing between CJK ideographs.
shrink_before: f32Additional shrink capacity at this boundary. Zero derives capacity from natural glue.
break_before: boolWhether a line may end immediately before this fragment.
break_penalty: i32Extra demerit for breaking before this fragment. Positive values make the break less desirable; a negative value encourages it.
flagged_break: boolWhether this is a flagged break such as a discretionary hyphen.
break_width: f32Width added only when the line ends at this boundary (for example the visible hyphen exercised by a discretionary break).
end_protrusion: f32Portion of this box allowed to protrude beyond the right margin when it ends a line. Typically a fraction of a closing punctuation glyph.
Implementations§
§impl ParagraphBox
impl ParagraphBox
pub const fn word(width: f32, glue_before: f32) -> ParagraphBox
Trait Implementations§
§impl Clone for ParagraphBox
impl Clone for ParagraphBox
§fn clone(&self) -> ParagraphBox
fn clone(&self) -> ParagraphBox
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ParagraphBox
impl Debug for ParagraphBox
§impl PartialEq for ParagraphBox
impl PartialEq for ParagraphBox
impl Copy for ParagraphBox
impl StructuralPartialEq for ParagraphBox
Auto Trait Implementations§
impl Freeze for ParagraphBox
impl RefUnwindSafe for ParagraphBox
impl Send for ParagraphBox
impl Sync for ParagraphBox
impl Unpin for ParagraphBox
impl UnsafeUnpin for ParagraphBox
impl UnwindSafe for ParagraphBox
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>
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)
&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)
&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<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>
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>
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