pub struct Runtime { /* private fields */ }Expand description
Allora builder holds configuration inputs prior to runtime construction.
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn with_config_file<P: AsRef<Path>>(self, path: P) -> Self
pub fn with_config_file<P: AsRef<Path>>(self, path: P) -> Self
Set an explicit configuration file path (overrides auto-discovery).
Accepts any type implementing AsRef<Path> (e.g. &str, PathBuf).
Relative paths are resolved according to the current working directory.
Does not validate path existence immediately; validation happens inside run().
Sourcepub fn run(self) -> Result<AlloraRuntime>
pub fn run(self) -> Result<AlloraRuntime>
Build the runtime from the explicit or default configuration file.
§Configuration Discovery
When no explicit path is provided via with_config_file():
- First checks for
allora.ymlin the current working directory - If not found, ascends parent directories from the executable location
up to
MAX_PARENT_SEARCH_DEPTH(10) levels - Returns an error if no config is found
§Note on Testing
The parent directory ascent from the executable location is difficult to test in isolation as it depends on the test executable’s location. Tests focus on explicit path configuration which covers the majority of production use cases.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Runtime
impl RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnwindSafe for Runtime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more