Struct deno_ast::MultiThreadedComments
source · [−]pub struct MultiThreadedComments { /* private fields */ }
Expand description
An implementation of swc’s Comments
that implements Sync
to support being used in multi-threaded code. This implementation
is immutable and should you need mutability you may create a copy
by converting it to an swc SingleThreadedComments
.
When using this, you will want to use the
deno_ast::swc::common::comments::Comments
trait.
Implementations
sourceimpl MultiThreadedComments
impl MultiThreadedComments
sourcepub fn from_single_threaded(comments: SingleThreadedComments) -> Self
pub fn from_single_threaded(comments: SingleThreadedComments) -> Self
Creates a new MultiThreadedComments
from an swc SingleThreadedComments
.
sourcepub fn as_single_threaded(&self) -> SingleThreadedComments
pub fn as_single_threaded(&self) -> SingleThreadedComments
Gets a clone of the underlying data as SingleThreadedComments
.
This may be useful for getting a mutable data structure for use when transpiling.
sourcepub fn leading_map(&self) -> &SingleThreadedCommentsMapInner
pub fn leading_map(&self) -> &SingleThreadedCommentsMapInner
Gets a reference to the leading comment map.
sourcepub fn trailing_map(&self) -> &SingleThreadedCommentsMapInner
pub fn trailing_map(&self) -> &SingleThreadedCommentsMapInner
Gets a reference to the trailing comment map.
Trait Implementations
sourceimpl Clone for MultiThreadedComments
impl Clone for MultiThreadedComments
sourcefn clone(&self) -> MultiThreadedComments
fn clone(&self) -> MultiThreadedComments
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 MultiThreadedComments
impl Comments for MultiThreadedComments
fn has_leading(&self, pos: BytePos) -> bool
fn get_leading(&self, pos: BytePos) -> Option<Vec<Comment>>
fn has_trailing(&self, pos: BytePos) -> bool
fn get_trailing(&self, pos: BytePos) -> Option<Vec<Comment>>
fn add_leading(&self, _pos: BytePos, _cmt: Comment)
fn add_leading_comments(&self, _pos: BytePos, _comments: Vec<Comment>)
fn move_leading(&self, _from: BytePos, _to: BytePos)
fn take_leading(&self, _pos: BytePos) -> Option<Vec<Comment>>
fn add_trailing(&self, _pos: BytePos, _cmt: Comment)
fn add_trailing_comments(&self, _pos: BytePos, _comments: Vec<Comment>)
fn move_trailing(&self, _from: BytePos, _to: BytePos)
fn take_trailing(&self, _pos: BytePos) -> Option<Vec<Comment>>
fn add_pure_comment(&self, _pos: BytePos)
fn with_leading<F, Ret>(&self, pos: BytePos, f: F) -> Ret where
F: FnOnce(&[Comment]) -> Ret,
fn with_trailing<F, Ret>(&self, pos: BytePos, f: F) -> Ret where
F: FnOnce(&[Comment]) -> Ret,
Auto Trait Implementations
impl RefUnwindSafe for MultiThreadedComments
impl Send for MultiThreadedComments
impl Sync for MultiThreadedComments
impl Unpin for MultiThreadedComments
impl UnwindSafe for MultiThreadedComments
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
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.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
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