linkrs_query/executor/streaming/helpers/
runtime_bridge.rs1#[cfg(any(feature = "vector", feature = "fulltext"))]
9use linkrs_core::error::QueryError;
10
11#[cfg(any(feature = "vector", feature = "fulltext"))]
14pub(crate) fn wait<F, T, E>(label: &str, future: F) -> Result<T, QueryError>
15where
16 F: std::future::Future<Output = Result<T, E>> + Send,
17 T: Send,
18 E: Send + std::fmt::Display,
19{
20 let label = format!("{label} failed");
21 linkrs_sync::runtime::block_on_ambient(future)
22 .map_err(|error| QueryError::execution(format!("{label}: {error}")))?
23 .map_err(|error| QueryError::execution(format!("{label}: {error}")))
24}