pub struct BreakLinePointProperties {
pub is_empty_line_breakpoint: bool,
pub precedence: usize,
pub break_indentation: BreakLinePointIndentation,
pub is_optional: bool,
pub space_if_not_broken: bool,
pub is_single_breakpoint: bool,
pub is_comma_if_broken: bool,
}
Expand description
Properties defining the behaviour of a break line point.
Fields§
§is_empty_line_breakpoint: bool
Indicates that the break line point was added instead of an empty line in the code, which means it must be preserved in the output. Notice that the number of consecutive empty line break points is limited and not all empty lines in the code creates an empty line break points.
precedence: usize
Breaking precedence, lower values will break first.
break_indentation: BreakLinePointIndentation
Dictates the breaking indentation behaviour.
is_optional: bool
Indicates whether a breakpoint is optional. An optional breakpoint may be broken only if the line is too long. A non-optional breakpoint is always broken.
space_if_not_broken: bool
Indicates to put a space instead of the break line point if it were not broken.
is_single_breakpoint: bool
Indicates that in a group of such breakpoints, only one should be broken, specifically the last one which fits in the line length.
is_comma_if_broken: bool
Indicates whether a comma should be added when the line breaks.
Implementations§
Source§impl BreakLinePointProperties
impl BreakLinePointProperties
pub fn new( precedence: usize, break_indentation: BreakLinePointIndentation, is_optional: bool, space_if_not_broken: bool, ) -> Self
pub fn set_comma_if_broken(&mut self)
pub fn is_comma_if_broken(&self) -> bool
pub fn new_empty_line() -> Self
pub fn set_single_breakpoint(&mut self)
pub fn set_line_by_line(&mut self)
pub fn unset_comma_if_broken(&mut self)
Trait Implementations§
Source§impl Clone for BreakLinePointProperties
impl Clone for BreakLinePointProperties
Source§fn clone(&self) -> BreakLinePointProperties
fn clone(&self) -> BreakLinePointProperties
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for BreakLinePointProperties
impl Debug for BreakLinePointProperties
Source§impl Ord for BreakLinePointProperties
impl Ord for BreakLinePointProperties
Source§impl PartialEq for BreakLinePointProperties
impl PartialEq for BreakLinePointProperties
Source§impl PartialOrd for BreakLinePointProperties
impl PartialOrd for BreakLinePointProperties
impl Eq for BreakLinePointProperties
impl StructuralPartialEq for BreakLinePointProperties
Auto Trait Implementations§
impl Freeze for BreakLinePointProperties
impl RefUnwindSafe for BreakLinePointProperties
impl Send for BreakLinePointProperties
impl Sync for BreakLinePointProperties
impl Unpin for BreakLinePointProperties
impl UnwindSafe for BreakLinePointProperties
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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