swc_ecma_codegen::text_writer

Type Alias Symbol

source
pub type Symbol = Str;
Expand description

TODO

Aliased Type§

struct Symbol {
    pub span: Span,
    pub value: Atom,
    pub raw: Option<Atom>,
}

Fields§

§span: Span§value: Atom§raw: Option<Atom>

Use None value only for transformations to avoid recalculate escaped characters in strings

Implementations

§

impl Str

pub fn is_empty(&self) -> bool

pub fn from_tpl_raw(tpl_raw: &str) -> Atom

Trait Implementations

§

impl Archive for Str

§

const COPY_OPTIMIZATION: CopyOptimization<Str> = _

An optimization flag that allows the bytes of this type to be copied directly to a writer instead of calling serialize. Read more
§

type Archived = ArchivedStr

The archived representation of this type. Read more
§

type Resolver = StrResolver

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
§

fn resolve( &self, resolver: <Str as Archive>::Resolver, out: Place<<Str as Archive>::Archived>, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
§

impl AstNode for Str

§

const TYPE: &'static str = "StringLiteral"

§

impl Clone for Str

§

fn clone(&self) -> Str

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Str

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for Str

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Str, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<__D> Deserialize<Str, __D> for <Str as Archive>::Archived
where __D: Fallible + ?Sized, <__D as Fallible>::Error: Source,

§

fn deserialize( &self, deserializer: &mut __D, ) -> Result<Str, <__D as Fallible>::Error>

Deserializes using the given deserializer
§

impl EqIgnoreSpan for Str

§

fn eq_ignore_span(&self, other: &Str) -> bool

§

impl From<&str> for Str

§

fn from(src: &str) -> Str

Converts to this type from the input type.
§

impl From<Atom> for Str

§

fn from(value: Atom) -> Str

Converts to this type from the input type.
§

impl From<Cow<'_, str>> for Str

§

fn from(src: Cow<'_, str>) -> Str

Converts to this type from the input type.
§

impl From<String> for Str

§

fn from(src: String) -> Str

Converts to this type from the input type.
§

impl Hash for Str

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Node for Str

source§

fn emit_with<W, S>(&self, e: &mut Emitter<'_, W, S>) -> Result
where W: WriteJs, S: SourceMapperExt + SourceMapper,

§

impl PartialEq for Str

§

fn eq(&self, other: &Str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<__S> Serialize<__S> for Str
where __S: Fallible + Writer + Allocator + ?Sized, <__S as Fallible>::Error: Source,

§

fn serialize( &self, serializer: &mut __S, ) -> Result<<Str as Archive>::Resolver, <__S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
§

impl Serialize for Str

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Spanned for Str

§

fn span(&self) -> Span

Get span of self.
§

fn span_lo(&self) -> BytePos

§

fn span_hi(&self) -> BytePos

§

impl Take for Str

§

fn dummy() -> Str

Create a dummy value of this type.
§

fn take(&mut self) -> Self

§

fn map_with_mut<F>(&mut self, op: F)
where F: FnOnce(Self) -> Self,

Mutate self using op, which accepts owned data.
§

impl Eq for Str

§

impl StructuralPartialEq for Str