pub struct LayoutPresetBuilder { /* private fields */ }Expand description
Builder for common layout presets.
Implementations§
Source§impl LayoutPresetBuilder
impl LayoutPresetBuilder
Sourcepub fn new(engine: impl Into<LayoutEngineId>, layout: LayoutRequest) -> Self
pub fn new(engine: impl Into<LayoutEngineId>, layout: LayoutRequest) -> Self
Creates a preset builder for a specific engine.
Sourcepub fn with_engine(self, engine: impl Into<LayoutEngineId>) -> Self
pub fn with_engine(self, engine: impl Into<LayoutEngineId>) -> Self
Uses a different engine.
Sourcepub fn with_layout(self, layout: LayoutRequest) -> Self
pub fn with_layout(self, layout: LayoutRequest) -> Self
Uses a different layout request.
Sourcepub fn with_options(self, options: LayoutOptions) -> Self
pub fn with_options(self, options: LayoutOptions) -> Self
Sets layout options.
Sourcepub fn with_direction(self, direction: LayoutDirection) -> Self
pub fn with_direction(self, direction: LayoutDirection) -> Self
Uses a different layered layout direction.
Sourcepub fn with_spacing(self, spacing: LayoutSpacing) -> Self
pub fn with_spacing(self, spacing: LayoutSpacing) -> Self
Uses a different layered spacing profile.
Sourcepub fn with_margin(self, margin: CanvasSize) -> Self
pub fn with_margin(self, margin: CanvasSize) -> Self
Uses a different margin.
Sourcepub fn with_default_node_size(self, size: CanvasSize) -> Self
pub fn with_default_node_size(self, size: CanvasSize) -> Self
Uses a different fallback node size.
Sourcepub fn with_node_origin(self, node_origin: (f32, f32)) -> Self
pub fn with_node_origin(self, node_origin: (f32, f32)) -> Self
Uses a different fallback node origin.
Sourcepub fn nodes(self, nodes: impl IntoIterator<Item = NodeId>) -> Self
pub fn nodes(self, nodes: impl IntoIterator<Item = NodeId>) -> Self
Targets a selected set of nodes.
Sourcepub fn with_scope(self, scope: LayoutScope) -> Self
pub fn with_scope(self, scope: LayoutScope) -> Self
Uses a different request scope.
Sourcepub fn with_measured_node_sizes(
self,
sizes: impl IntoIterator<Item = (NodeId, CanvasSize)>,
) -> Self
pub fn with_measured_node_sizes( self, sizes: impl IntoIterator<Item = (NodeId, CanvasSize)>, ) -> Self
Adds request-local measured node sizes.
Sourcepub fn build(self) -> LayoutEngineRequest
pub fn build(self) -> LayoutEngineRequest
Builds a layout engine request.
Sourcepub fn layout_request(&self) -> LayoutRequest
pub fn layout_request(&self) -> LayoutRequest
Returns the layout request without consuming the builder.
Sourcepub fn engine_request(&self) -> LayoutEngineRequest
pub fn engine_request(&self) -> LayoutEngineRequest
Returns the engine request without consuming the builder.
Trait Implementations§
Source§impl Clone for LayoutPresetBuilder
impl Clone for LayoutPresetBuilder
Source§fn clone(&self) -> LayoutPresetBuilder
fn clone(&self) -> LayoutPresetBuilder
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 moreSource§impl Debug for LayoutPresetBuilder
impl Debug for LayoutPresetBuilder
Source§impl Default for LayoutPresetBuilder
impl Default for LayoutPresetBuilder
Source§impl<'de> Deserialize<'de> for LayoutPresetBuilder
impl<'de> Deserialize<'de> for LayoutPresetBuilder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<LayoutPresetBuilder> for LayoutEngineRequest
impl From<LayoutPresetBuilder> for LayoutEngineRequest
Source§fn from(value: LayoutPresetBuilder) -> Self
fn from(value: LayoutPresetBuilder) -> Self
Converts to this type from the input type.
Source§impl PartialEq for LayoutPresetBuilder
impl PartialEq for LayoutPresetBuilder
Source§fn eq(&self, other: &LayoutPresetBuilder) -> bool
fn eq(&self, other: &LayoutPresetBuilder) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for LayoutPresetBuilder
impl Serialize for LayoutPresetBuilder
impl StructuralPartialEq for LayoutPresetBuilder
Auto Trait Implementations§
impl Freeze for LayoutPresetBuilder
impl RefUnwindSafe for LayoutPresetBuilder
impl Send for LayoutPresetBuilder
impl Sync for LayoutPresetBuilder
impl Unpin for LayoutPresetBuilder
impl UnsafeUnpin for LayoutPresetBuilder
impl UnwindSafe for LayoutPresetBuilder
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