pub struct AttrStore { /* private fields */ }
Expand description
A storage structure that manages formatting attributes for syntax nodes.
Implementations§
Source§impl AttrStore
impl AttrStore
Sourcepub fn new(node: &SyntaxNode) -> AttrStore
pub fn new(node: &SyntaxNode) -> AttrStore
Creates a new AttrStore
by computing formatting-related attributes
for all descendants of the given syntax node.
Sourcepub fn has_comment(&self, node: &SyntaxNode) -> bool
pub fn has_comment(&self, node: &SyntaxNode) -> bool
Checks if a given syntax node contains a comment.
pub fn has_multiline_str(&self, node: &SyntaxNode) -> bool
pub fn has_math_align_point(&self, node: &SyntaxNode) -> bool
pub fn can_align_in_math(&self, node: &SyntaxNode) -> bool
Sourcepub fn is_multiline(&self, node: &SyntaxNode) -> bool
pub fn is_multiline(&self, node: &SyntaxNode) -> bool
Checks if a given syntax node or any of its descendants contains a linebreak.
Sourcepub fn is_format_disabled(&self, node: &SyntaxNode) -> bool
pub fn is_format_disabled(&self, node: &SyntaxNode) -> bool
Checks if formatting is explicitly disabled for a given syntax node.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AttrStore
impl RefUnwindSafe for AttrStore
impl Send for AttrStore
impl Sync for AttrStore
impl Unpin for AttrStore
impl UnwindSafe for AttrStore
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
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>
Converts
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>
Converts
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