pub struct ListLayout { /* private fields */ }Expand description
List layout engine
Implementations§
Source§impl ListLayout
impl ListLayout
Sourcepub fn with_label_width(self, width: Length) -> Self
pub fn with_label_width(self, width: Length) -> Self
Set label end position (provisional-distance-between-starts - provisional-label-separation)
This corresponds to the label-end() function value in XSL-FO.
Sourcepub fn with_label_separation(self, separation: Length) -> Self
pub fn with_label_separation(self, separation: Length) -> Self
Set label separation (provisional-label-separation)
Sourcepub fn with_body_start(self, body_start: Length) -> Self
pub fn with_body_start(self, body_start: Length) -> Self
Set body start position (provisional-distance-between-starts)
This corresponds to the body-start() function value in XSL-FO.
Sourcepub fn body_width(&self) -> Length
pub fn body_width(&self) -> Length
Calculate body width (available_width - body_start)
Sourcepub fn body_start(&self) -> Length
pub fn body_start(&self) -> Length
Calculate body start x position — corresponds to body-start() in XSL-FO
Sourcepub fn label_end(&self) -> Length
pub fn label_end(&self) -> Length
Calculate label end position — corresponds to label-end() in XSL-FO
Sourcepub fn body_start_x(&self) -> Length
pub fn body_start_x(&self) -> Length
Deprecated: use body_start() instead
Sourcepub fn layout_item(
&self,
area_tree: &mut AreaTree,
y_position: Length,
label_content: Option<&str>,
body_height: Length,
) -> Result<ListItemLayout>
pub fn layout_item( &self, area_tree: &mut AreaTree, y_position: Length, label_content: Option<&str>, body_height: Length, ) -> Result<ListItemLayout>
Layout a single list item
Sourcepub fn layout_list(
&self,
area_tree: &mut AreaTree,
items: &[(Option<String>, Length)],
start_y: Length,
) -> Result<Vec<ListItemLayout>>
pub fn layout_list( &self, area_tree: &mut AreaTree, items: &[(Option<String>, Length)], start_y: Length, ) -> Result<Vec<ListItemLayout>>
Layout a complete list
Sourcepub fn generate_marker(&self, index: usize, style: ListMarkerStyle) -> String
pub fn generate_marker(&self, index: usize, style: ListMarkerStyle) -> String
Generate marker text based on list style
Auto Trait Implementations§
impl Freeze for ListLayout
impl RefUnwindSafe for ListLayout
impl Send for ListLayout
impl Sync for ListLayout
impl Unpin for ListLayout
impl UnsafeUnpin for ListLayout
impl UnwindSafe for ListLayout
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> 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