pub struct RustSyntax;Expand description
Rust-specific code generation syntax.
Trait Implementations§
Source§impl LanguageSyntax for RustSyntax
impl LanguageSyntax for RustSyntax
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
Auto Trait Implementations§
impl Freeze for RustSyntax
impl RefUnwindSafe for RustSyntax
impl Send for RustSyntax
impl Sync for RustSyntax
impl Unpin for RustSyntax
impl UnwindSafe for RustSyntax
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