[−][src]Struct swc_common::comments::SingleThreadedComments
Single-threaded storage for comments.
Implementations
impl SingleThreadedComments
[src]
pub fn take_all(self) -> (SingleThreadedCommentsMap, SingleThreadedCommentsMap)
[src]
Takes all the comments as (leading, trailing).
pub fn borrow_all<'a>(
&'a self
) -> (Ref<'a, SingleThreadedCommentsMapInner>, Ref<'a, SingleThreadedCommentsMapInner>)
[src]
&'a self
) -> (Ref<'a, SingleThreadedCommentsMapInner>, Ref<'a, SingleThreadedCommentsMapInner>)
Borrows all the comments as (leading, trailing).
pub fn with_leading<F, Ret>(&self, pos: BytePos, op: F) -> Ret where
F: FnOnce(&[Comment]) -> Ret,
[src]
F: FnOnce(&[Comment]) -> Ret,
pub fn with_trailing<F, Ret>(&self, pos: BytePos, op: F) -> Ret where
F: FnOnce(&[Comment]) -> Ret,
[src]
F: FnOnce(&[Comment]) -> Ret,
Trait Implementations
impl Clone for SingleThreadedComments
[src]
pub fn clone(&self) -> SingleThreadedComments
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Comments for SingleThreadedComments
[src]
pub fn add_leading(&self, pos: BytePos, cmt: Comment)
[src]
pub fn add_leading_comments(&self, pos: BytePos, comments: Vec<Comment>)
[src]
pub fn has_leading(&self, pos: BytePos) -> bool
[src]
pub fn move_leading(&self, from: BytePos, to: BytePos)
[src]
pub fn take_leading(&self, pos: BytePos) -> Option<Vec<Comment>>
[src]
pub fn add_trailing(&self, pos: BytePos, cmt: Comment)
[src]
pub fn add_trailing_comments(&self, pos: BytePos, comments: Vec<Comment>)
[src]
pub fn has_trailing(&self, pos: BytePos) -> bool
[src]
pub fn move_trailing(&self, from: BytePos, to: BytePos)
[src]
pub fn take_trailing(&self, pos: BytePos) -> Option<Vec<Comment>>
[src]
impl Debug for SingleThreadedComments
[src]
impl Default for SingleThreadedComments
[src]
pub fn default() -> SingleThreadedComments
[src]
Auto Trait Implementations
impl !RefUnwindSafe for SingleThreadedComments
impl !Send for SingleThreadedComments
impl !Sync for SingleThreadedComments
impl Unpin for SingleThreadedComments
impl !UnwindSafe for SingleThreadedComments
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,