Struct swc::SwcComments
source · [−]pub struct SwcComments {
pub leading: Arc<DashMap<BytePos, Vec<Comment, Global>, RandomState>>,
pub trailing: Arc<DashMap<BytePos, Vec<Comment, Global>, RandomState>>,
}
Expand description
Multi-threaded implementation of Comments
Fields
leading: Arc<DashMap<BytePos, Vec<Comment, Global>, RandomState>>
trailing: Arc<DashMap<BytePos, Vec<Comment, Global>, RandomState>>
Trait Implementations
sourceimpl Clone for SwcComments
impl Clone for SwcComments
sourcepub fn clone(&self) -> SwcComments
pub fn clone(&self) -> SwcComments
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Comments for SwcComments
impl Comments for SwcComments
pub fn add_leading(&self, pos: BytePos, cmt: Comment)
pub fn add_leading_comments(&self, pos: BytePos, comments: Vec<Comment, Global>)
pub fn has_leading(&self, pos: BytePos) -> bool
pub fn move_leading(&self, from: BytePos, to: BytePos)
pub fn take_leading(&self, pos: BytePos) -> Option<Vec<Comment, Global>>
pub fn get_leading(&self, pos: BytePos) -> Option<Vec<Comment, Global>>
pub fn add_trailing(&self, pos: BytePos, cmt: Comment)
pub fn add_trailing_comments(
&self,
pos: BytePos,
comments: Vec<Comment, Global>
)
pub fn has_trailing(&self, pos: BytePos) -> bool
pub fn move_trailing(&self, from: BytePos, to: BytePos)
pub fn take_trailing(&self, pos: BytePos) -> Option<Vec<Comment, Global>>
pub fn get_trailing(&self, pos: BytePos) -> Option<Vec<Comment, Global>>
pub fn add_pure_comment(&self, pos: BytePos)
pub fn with_leading<F, Ret>(&self, pos: BytePos, f: F) -> Ret where
F: FnOnce(&[Comment]) -> Ret,
SwcComments: Sized,
pub fn with_trailing<F, Ret>(&self, pos: BytePos, f: F) -> Ret where
F: FnOnce(&[Comment]) -> Ret,
SwcComments: Sized,
sourceimpl Default for SwcComments
impl Default for SwcComments
sourcepub fn default() -> SwcComments
pub fn default() -> SwcComments
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for SwcComments
impl Send for SwcComments
impl Sync for SwcComments
impl Unpin for SwcComments
impl !UnwindSafe for SwcComments
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<C> CommentsExt for C where
C: Comments,
impl<C> CommentsExt for C where
C: Comments,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more