Open moqle opened 3 hours ago
Hi @moqle,
Thankyou for trying out the domain
crate, especially the unstable Zone
feature and the MySQL example!
https://docs.rs/domain/latest/domain/zonetree/trait.ReadableZone.html#method.query_async shows that the function signature includes both Send
and Sync
:
fn query_async(
&self,
qname: Name<Bytes>,
qtype: Rtype,
) -> Pin<Box<dyn Future<Output = Result<Answer, OutOfZone>> + Send + Sync>>
Your code fragment lacks the Sync
bound. Perhaps you need to add it?
Ximon
Box::pin(fut) | ^^^^^^^^^^^^^
dyn Future<Output = std::result::Result<Vec<MySqlRow>, sqlx::Error>> + std::marker::Send
cannot be shared between threads safelyHow can I fixed it?