pub struct JavaScriptSyntax;Expand description
JavaScript-specific code generation syntax.
Trait Implementations§
Source§impl LanguageSyntax for JavaScriptSyntax
impl LanguageSyntax for JavaScriptSyntax
Source§fn field_name(&self, name: &str) -> String
fn field_name(&self, name: &str) -> String
Convert a field name to the language’s naming convention. Read more
Source§fn path_expr(&self, base_var: &str, suffix: &str) -> String
fn path_expr(&self, base_var: &str, suffix: &str) -> String
Format an interpolated path expression. Read more
Source§fn suffix_expr(&self, acc_var: &str, relative: &str) -> String
fn suffix_expr(&self, acc_var: &str, relative: &str) -> String
Format a suffix mode expression:
_m(acc, relative). Read moreSource§fn prefix_expr(&self, prefix: &str, acc_var: &str) -> String
fn prefix_expr(&self, prefix: &str, acc_var: &str) -> String
Format a prefix mode expression:
_p(prefix, acc). Read moreSource§fn constructor(&self, type_name: &str, path_expr: &str) -> String
fn constructor(&self, type_name: &str, path_expr: &str) -> String
Generate a constructor call for patterns and accessors. Read more
Source§fn field_init(
&self,
indent: &str,
name: &str,
_type_ann: &str,
value: &str,
) -> String
fn field_init( &self, indent: &str, name: &str, _type_ann: &str, value: &str, ) -> String
Generate a field initialization line. Read more
Source§fn generic_syntax(&self) -> GenericSyntax
fn generic_syntax(&self) -> GenericSyntax
Get the generic type syntax for this language. Read more
Source§fn constructor_name(&self, type_name: &str) -> String
fn constructor_name(&self, type_name: &str) -> String
Get the constructor name/prefix for a type. Read more
Source§fn disc_arg_expr(&self, template: &str) -> String
fn disc_arg_expr(&self, template: &str) -> String
Format a discriminator argument for passing to a templated child. Read more
Auto Trait Implementations§
impl Freeze for JavaScriptSyntax
impl RefUnwindSafe for JavaScriptSyntax
impl Send for JavaScriptSyntax
impl Sync for JavaScriptSyntax
impl Unpin for JavaScriptSyntax
impl UnsafeUnpin for JavaScriptSyntax
impl UnwindSafe for JavaScriptSyntax
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more