pub(crate) struct GenerateCodeFor {
pub(crate) template: PathBuf,
pub(crate) target: PathBuf,
pub(crate) markers: Vec<(GenerationKind, HashSet<TypeDeclId>)>,
}Expand description
Replace markers in template with auto-generated code.
Fields§
§template: PathBuf§target: PathBuf§markers: Vec<(GenerationKind, HashSet<TypeDeclId>)>Each list corresponds to a marker. We replace the ith __REPLACE{i}__ marker with
generated code for each definition in the ith list.
Eventually we should reorder definitions so the generated ones are all in one block. Keeping the order is important while we migrate away from hand-written code.
Implementations§
Source§impl GenerateCodeFor
impl GenerateCodeFor
pub(crate) fn generate(&self, ctx: &GenerateCtx<'_>) -> Result<()>
Auto Trait Implementations§
impl Freeze for GenerateCodeFor
impl RefUnwindSafe for GenerateCodeFor
impl Send for GenerateCodeFor
impl Sync for GenerateCodeFor
impl Unpin for GenerateCodeFor
impl UnwindSafe for GenerateCodeFor
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
§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more