pub struct ElementSort<'a> { /* private fields */ }Expand description
A sort of an array’s elements, waiting to be told how to order them.
Built by CstArray::sort_elements.
Implementations§
Source§impl<'a> ElementSort<'a>
impl<'a> ElementSort<'a>
Sourcepub fn pin_comment_headers(self) -> Self
pub fn pin_comment_headers(self) -> Self
Leaves a comment that heads a group of elements where it was written.
Behaves like PropertySort::pin_comment_headers.
Sourcepub fn pin_comment_headers_with(
self,
rule: impl FnMut(&CstNode, &[CstComment]) -> usize + 'a,
) -> Self
pub fn pin_comment_headers_with( self, rule: impl FnMut(&CstNode, &[CstComment]) -> usize + 'a, ) -> Self
Decides for each element how much of what was written above it is a heading for what follows rather than part of the element.
Behaves like PropertySort::pin_comment_headers_with.
Sourcepub fn within_groups(self) -> Self
pub fn within_groups(self) -> Self
Sorts each run of elements between blank lines on its own, so that no element crosses one.
Behaves like PropertySort::within_groups.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ElementSort<'a>
impl<'a> !Send for ElementSort<'a>
impl<'a> !Sync for ElementSort<'a>
impl<'a> !UnwindSafe for ElementSort<'a>
impl<'a> Freeze for ElementSort<'a>
impl<'a> Unpin for ElementSort<'a>
impl<'a> UnsafeUnpin for ElementSort<'a>
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