Skip to content

Calling functions in external crates directly from handle _request function. #107

Answered by temeddix
hareendranmg asked this question in Q&A
Discussion options

You must be logged in to vote

It would be nice if this was possible, but since RustResponse struct is defined in the hub crate, all request handlers that has type annotations of this RustResponse struct should be defined in hub, not other crates.

This is basically because 'When crate A depends on crate B, crate B cannot depend on crate A'.

So in your case, you can call functions like:
handle_request >> custom_handler_function_in_hub >> custom_function_in_other_crate
instead of:
handle_request >> custom_function_in_other_crate

Hope this helps :)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hareendranmg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants