pub struct LayoutContext {
pub measured_node_sizes: BTreeMap<NodeId, CanvasSize>,
pub pinned_nodes: BTreeSet<NodeId>,
pub node_origin: Option<(f32, f32)>,
}Expand description
Runtime or host-owned context available to layout engines.
Fields§
§measured_node_sizes: BTreeMap<NodeId, CanvasSize>Runtime-reported node sizes. Graph node sizes and request-local measured sizes win.
pinned_nodes: BTreeSet<NodeId>Nodes that engines should treat as fixed when they support pinning.
node_origin: Option<(f32, f32)>Runtime fallback node origin, usually resolved from interaction state.
Implementations§
Source§impl LayoutContext
impl LayoutContext
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 runtime-reported node sizes.
Sourcepub fn with_pinned_nodes(self, nodes: impl IntoIterator<Item = NodeId>) -> Self
pub fn with_pinned_nodes(self, nodes: impl IntoIterator<Item = NodeId>) -> Self
Adds nodes that engines should keep fixed when possible.
Sourcepub fn with_node_origin(self, node_origin: (f32, f32)) -> Self
pub fn with_node_origin(self, node_origin: (f32, f32)) -> Self
Sets the runtime fallback node origin.
Trait Implementations§
Source§impl Clone for LayoutContext
impl Clone for LayoutContext
Source§fn clone(&self) -> LayoutContext
fn clone(&self) -> LayoutContext
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 LayoutContext
impl Debug for LayoutContext
Source§impl Default for LayoutContext
impl Default for LayoutContext
Source§fn default() -> LayoutContext
fn default() -> LayoutContext
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LayoutContext
impl<'de> Deserialize<'de> for LayoutContext
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 PartialEq for LayoutContext
impl PartialEq for LayoutContext
Source§fn eq(&self, other: &LayoutContext) -> bool
fn eq(&self, other: &LayoutContext) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for LayoutContext
impl Serialize for LayoutContext
impl StructuralPartialEq for LayoutContext
Auto Trait Implementations§
impl Freeze for LayoutContext
impl RefUnwindSafe for LayoutContext
impl Send for LayoutContext
impl Sync for LayoutContext
impl Unpin for LayoutContext
impl UnsafeUnpin for LayoutContext
impl UnwindSafe for LayoutContext
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