Skip to content

How can I call self method from from Command::perform? #1012

Answered by yusdacra
H36615 asked this question in Q&A
Discussion options

You must be logged in to vote

Your get_data_async method borrows some data from self, and Commands require 'static lifetime, but self is not 'static, so Rust complains. You should Clone (.clone()) whatever data you need to perform the async code in get_data_async, so that nothing is borrowed from self.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@H36615
Comment options

@H36615
Comment options

@yusdacra
Comment options

Answer selected by hecrj
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