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
.
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.
sourcepub fn get_vec(&self) -> Vec<Comment>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_vec(&self) -> Vec<Comment>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Gets a vector of all the comments sorted by position.
pub fn has_leading(&self, pos: SourcePos) -> bool
pub fn get_leading(&self, pos: SourcePos) -> Option<&Vec<Comment>>
pub fn has_trailing(&self, pos: SourcePos) -> bool
pub fn get_trailing(&self, pos: SourcePos) -> Option<&Vec<Comment>>
pub fn as_swc_comments(&self) -> Box<dyn SwcComments>
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
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<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>
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