We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
error[E0308]: mismatched types --> lit-attestation-service/src/handlers/attestation_intent.rs:34:9 | 34 | / Box::pin(async move { 35 | | debug!(req = as_serde!(req); "AttestationIntentHandler"); 36 | | 37 | | // Create initial Attestation object. ... | 77 | | Ok(AttestationIntentResp { attestation, session_id }) 78 | | }) | |__________^ one type is more general than the other | = note: expected struct `Box<dyn Any + std::marker::Send + Sync>` found struct `Box<dyn Any + std::marker::Send + Sync>` error: higher-ranked lifetime error --> lit-attestation-service/src/handlers/attestation_intent.rs:34:9 | 34 | / Box::pin(async move { 35 | | debug!(req = as_serde!(req); "AttestationIntentHandler"); 36 | | 37 | | // Create initial Attestation object. ... | 77 | | Ok(AttestationIntentResp { attestation, session_id }) 78 | | }) | |__________^ | = note: could not prove `Pin<Box<[async block@lit-attestation-service/src/handlers/attestation_intent.rs:34:18: 78:10]>>: CoerceUnsized<Pin<Box<(dyn futures::Future<Output = std::result::Result<AttestationIntentResp, lit_attestation::Error>> + std::marker::Send + 'b)>>>`
Which happens when i use async_trait or directly use BoxFuture. It all relates to this line:
CACHE.insert(session_id.clone(), Box::new(attestation.clone()), 1).await;
My cache is constructed:
pub static CACHE: Lazy<AsyncCache<String, Box<dyn Any + Send + Sync>>> = Lazy::new(|| AsyncCache::new(100, 10, tokio::spawn).expect("failed to create cache"));
The text was updated successfully, but these errors were encountered:
Someone in the rust community (bruh![moment]) was able to get it working, if we create:
fn cache_session(session_id: String, attestation: Attestation) -> BoxFuture<'static, bool> { CACHE.insert(session_id, Box::new(attestation), 1).boxed() }
and call that instead, it works!
So perhaps you need to provide a BoxFuture instead here?
Sorry, something went wrong.
Thanks! I will look at it later.
No branches or pull requests
Which happens when i use async_trait or directly use BoxFuture. It all relates to this line:
My cache is constructed:
The text was updated successfully, but these errors were encountered: