#[non_exhaustive]pub struct SegmentDefaults {
pub priority: u8,
pub width: Option<WidthBounds>,
pub truncatable: bool,
}Expand description
Layout intent declared by a segment; user config may override each field.
Under width pressure the engine drops segments in descending
priority order: 255 drops first, 0 never drops. Default 128.
Ties break by position: the right-most segment drops first.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.priority: u8§width: Option<WidthBounds>§truncatable: boolMay the layout engine shrink this segment under width pressure
before dropping it? Default false — only prose-like segments
(workspace name, branch name) opt in. Numeric or structured
segments leave this false: a half-cut percentage reads as
the wrong number, which is worse than no number.
See docs/specs/segment-system.md §Layout algorithm.
Implementations§
Source§impl SegmentDefaults
impl SegmentDefaults
Sourcepub fn with_priority(priority: u8) -> Self
pub fn with_priority(priority: u8) -> Self
Constructor shorthand for the common case of “default layout
intent with a specific priority.” Chainable with
Self::with_width and Self::with_truncatable.
Sourcepub fn with_width(self, bounds: WidthBounds) -> Self
pub fn with_width(self, bounds: WidthBounds) -> Self
Chainable setter for width bounds.
Sourcepub fn with_truncatable(self, truncatable: bool) -> Self
pub fn with_truncatable(self, truncatable: bool) -> Self
Chainable setter for the truncate-before-drop opt-in.
Trait Implementations§
Source§impl Clone for SegmentDefaults
impl Clone for SegmentDefaults
Source§fn clone(&self) -> SegmentDefaults
fn clone(&self) -> SegmentDefaults
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SegmentDefaults
impl Debug for SegmentDefaults
Source§impl Default for SegmentDefaults
impl Default for SegmentDefaults
Source§impl PartialEq for SegmentDefaults
impl PartialEq for SegmentDefaults
Source§fn eq(&self, other: &SegmentDefaults) -> bool
fn eq(&self, other: &SegmentDefaults) -> bool
self and other values to be equal, and is used by ==.impl Copy for SegmentDefaults
impl Eq for SegmentDefaults
impl StructuralPartialEq for SegmentDefaults
Auto Trait Implementations§
impl Freeze for SegmentDefaults
impl RefUnwindSafe for SegmentDefaults
impl Send for SegmentDefaults
impl Sync for SegmentDefaults
impl Unpin for SegmentDefaults
impl UnsafeUnpin for SegmentDefaults
impl UnwindSafe for SegmentDefaults
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.