pub struct TriviaRanges { /* private fields */ }Expand description
Token-derived range indexes shared by comment placement and formatting.
Implementations§
Source§impl TriviaRanges
impl TriviaRanges
Sourcepub fn new(
comments: CommentRanges,
parenthesized_expressions: ParenthesizedExpressions,
) -> Self
pub fn new( comments: CommentRanges, parenthesized_expressions: ParenthesizedExpressions, ) -> Self
Creates a combined set of token-derived range indexes.
Sourcepub fn comments(&self) -> &CommentRanges
pub fn comments(&self) -> &CommentRanges
Returns the indexed comment ranges.
Sourcepub fn parenthesized(&self) -> &ParenthesizedExpressions
pub fn parenthesized(&self) -> &ParenthesizedExpressions
Returns the indexed parenthesized expression ranges.
Trait Implementations§
Source§impl Clone for TriviaRanges
impl Clone for TriviaRanges
Source§fn clone(&self) -> TriviaRanges
fn clone(&self) -> TriviaRanges
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 TriviaRanges
impl Debug for TriviaRanges
Source§impl Default for TriviaRanges
impl Default for TriviaRanges
Source§fn default() -> TriviaRanges
fn default() -> TriviaRanges
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TriviaRanges
impl RefUnwindSafe for TriviaRanges
impl Send for TriviaRanges
impl Sync for TriviaRanges
impl Unpin for TriviaRanges
impl UnsafeUnpin for TriviaRanges
impl UnwindSafe for TriviaRanges
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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