Phase 3 of the rebrand cascade per locked decision D4. MagnotiaError -> Error in crates/core/src/error.rs (the crate name already qualifies it). 92 usages across 14 .rs files renamed via word-boundary sed. One collision required disambiguation: lumotia_storage already had its own local Error type (introduced by the slop-pass Area A residuals work). crates/storage/src/error.rs aliases the imported core error as CoreError on import; the From<Error> for CoreError boundary impl and the CoreError::Storage construction site use the alias. cargo build --workspace passes. cargo test --workspace: 330 pass, 0 fail. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
19 lines
666 B
Rust
19 lines
666 B
Rust
use std::sync::Arc;
|
|
|
|
use lumotia_core::error::{Error, Result};
|
|
use lumotia_core::types::{AudioSamples, TranscriptionOptions};
|
|
|
|
use crate::local_engine::{LocalEngine, TimedTranscript};
|
|
|
|
/// Runs inference on a blocking thread. Encapsulates all threading concerns.
|
|
/// Callers never see spawn_blocking — they call this async function.
|
|
pub async fn run_inference(
|
|
engine: Arc<LocalEngine>,
|
|
audio: AudioSamples,
|
|
options: TranscriptionOptions,
|
|
) -> Result<TimedTranscript> {
|
|
tokio::task::spawn_blocking(move || engine.transcribe_sync(&audio, &options))
|
|
.await
|
|
.map_err(|e| Error::TranscriptionFailed(format!("Task join error: {e}")))?
|
|
}
|