pub struct NodeSurfaceLayoutBudget {
pub min_readable_size: Option<CanvasSize>,
pub preferred_size: Option<CanvasSize>,
pub slot_line_budget: Option<usize>,
pub control_line_budget: Option<usize>,
pub repeatable_visible_items: Option<usize>,
pub overflow_indicator: Option<NodeSurfaceOverflowIndicator>,
pub density_priority: Vec<NodeKitContentDensity>,
}Expand description
Semantic layout budget for readable node-internal product surfaces.
Fields§
§min_readable_size: Option<CanvasSize>Minimum logical node size needed before rendering full-density internals.
preferred_size: Option<CanvasSize>Preferred logical node size for first render or resize suggestions.
slot_line_budget: Option<usize>Maximum logical text lines adapters should budget for ordinary slots.
control_line_budget: Option<usize>Maximum logical text lines adapters should budget for controls.
repeatable_visible_items: Option<usize>Suggested visible repeatable item count before showing overflow.
overflow_indicator: Option<NodeSurfaceOverflowIndicator>Semantic overflow affordance expected when content is capped.
density_priority: Vec<NodeKitContentDensity>Density tiers adapters should prefer when the full surface does not fit.
Implementations§
Source§impl NodeSurfaceLayoutBudget
impl NodeSurfaceLayoutBudget
pub fn with_min_readable_size(self, size: CanvasSize) -> Self
pub fn with_preferred_size(self, size: CanvasSize) -> Self
pub fn with_slot_line_budget(self, lines: usize) -> Self
pub fn with_control_line_budget(self, lines: usize) -> Self
pub fn with_repeatable_visible_items(self, items: usize) -> Self
pub fn with_overflow_indicator( self, indicator: NodeSurfaceOverflowIndicator, ) -> Self
pub fn with_density_priority( self, density_priority: impl IntoIterator<Item = NodeKitContentDensity>, ) -> Self
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for NodeSurfaceLayoutBudget
impl Clone for NodeSurfaceLayoutBudget
Source§fn clone(&self) -> NodeSurfaceLayoutBudget
fn clone(&self) -> NodeSurfaceLayoutBudget
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 NodeSurfaceLayoutBudget
impl Debug for NodeSurfaceLayoutBudget
Source§impl Default for NodeSurfaceLayoutBudget
impl Default for NodeSurfaceLayoutBudget
Source§fn default() -> NodeSurfaceLayoutBudget
fn default() -> NodeSurfaceLayoutBudget
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for NodeSurfaceLayoutBudget
impl<'de> Deserialize<'de> for NodeSurfaceLayoutBudget
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 NodeSurfaceLayoutBudget
impl PartialEq for NodeSurfaceLayoutBudget
Source§fn eq(&self, other: &NodeSurfaceLayoutBudget) -> bool
fn eq(&self, other: &NodeSurfaceLayoutBudget) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for NodeSurfaceLayoutBudget
impl Serialize for NodeSurfaceLayoutBudget
impl StructuralPartialEq for NodeSurfaceLayoutBudget
Auto Trait Implementations§
impl Freeze for NodeSurfaceLayoutBudget
impl RefUnwindSafe for NodeSurfaceLayoutBudget
impl Send for NodeSurfaceLayoutBudget
impl Sync for NodeSurfaceLayoutBudget
impl Unpin for NodeSurfaceLayoutBudget
impl UnsafeUnpin for NodeSurfaceLayoutBudget
impl UnwindSafe for NodeSurfaceLayoutBudget
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