Skip to main content

init_backends_with

Function init_backends_with 

Source
pub fn init_backends_with(
    dir: Option<impl AsRef<Path>>,
    allowed: BackendMask,
) -> Result<()>
Expand description

init_backends / init_backends_default (dir = None) with an allowed-backend mask. The mask is fixed at first backend registration; call this first, once per process. A later call with a different effective mask returns crate::Error::Backend.

use transcribe_cpp::{init_backends_with, Backend, BackendMask};
// A CPU fallback worker: never let the GPU driver load.
init_backends_with(None::<&std::path::Path>, BackendMask::for_backend(Backend::Cpu))?;