Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate more edge-handling code in trustfall_stubgen #346

Closed
obi1kenobi opened this issue Jul 7, 2023 · 0 comments · Fixed by #352
Closed

Generate more edge-handling code in trustfall_stubgen #346

obi1kenobi opened this issue Jul 7, 2023 · 0 comments · Fixed by #352
Labels
A-adapter Area: plugging data sources into the interpreter C-enhancement Category: raise the bar on expectations E-easy Call for participation: experience needed to fix: easy / not much (good first issue) L-rust Language: affects use cases in the Rust programming language

Comments

@obi1kenobi
Copy link
Owner

We can generate more of the body of edge handler functions. We currently leave a todo!() as the body, but most edges are resolved one-at-a-time and we can make by generating a body like this:

    pub(super) fn generated_edge_fn<'a>(
        contexts: ContextIterator<'a, Vertex>,
        _resolve_info: &ResolveEdgeInfo,
    ) -> ContextOutcomeIterator<'a, Vertex, VertexIterator<'a, Vertex>> {
        resolve_neighbors_with(contexts, |vertex| {
            let vertex = vertex.as_<generated>().expect("not a <VertexType>");
            let neighbors = todo!(...);
            Box::new(neighbors)
        })
    }
@obi1kenobi obi1kenobi added A-adapter Area: plugging data sources into the interpreter C-enhancement Category: raise the bar on expectations E-easy Call for participation: experience needed to fix: easy / not much (good first issue) L-rust Language: affects use cases in the Rust programming language labels Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-adapter Area: plugging data sources into the interpreter C-enhancement Category: raise the bar on expectations E-easy Call for participation: experience needed to fix: easy / not much (good first issue) L-rust Language: affects use cases in the Rust programming language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant