pub struct RuntimeBuilder { /* private fields */ }Expand description
Builds a Runtime: roots in precedence order (later roots override earlier ones for the
same id@version) and the backends to dispatch to.
Implementations§
Source§impl RuntimeBuilder
impl RuntimeBuilder
Sourcepub fn root(self, path: impl Into<PathBuf>) -> Self
pub fn root(self, path: impl Into<PathBuf>) -> Self
A directory of transforms (<path>/<name>/transform.toml), named after its last path
segment. A path that does not exist contributes nothing.
Sourcepub fn named_root(
self,
name: impl Into<String>,
path: impl Into<PathBuf>,
) -> Self
pub fn named_root( self, name: impl Into<String>, path: impl Into<PathBuf>, ) -> Self
A directory of transforms with an explicit name (shown in diagnostics and the catalog).
Sourcepub fn source(self, root: impl Root + 'static) -> Self
pub fn source(self, root: impl Root + 'static) -> Self
Any other source of transforms — your own Root implementation.
Sourcepub fn backend(self, backend: impl TransformBackend + 'static) -> Self
pub fn backend(self, backend: impl TransformBackend + 'static) -> Self
Register a backend. One per crate::ImplKind; a later registration for the same kind
replaces the earlier one.
Sourcepub fn build(self) -> Result<Runtime, RegistryError>
pub fn build(self) -> Result<Runtime, RegistryError>
Discover and validate every transform under the roots. A malformed manifest anywhere is an error here, not at run time.
Trait Implementations§
Source§impl Default for RuntimeBuilder
impl Default for RuntimeBuilder
Source§fn default() -> RuntimeBuilder
fn default() -> RuntimeBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for RuntimeBuilder
impl !UnwindSafe for RuntimeBuilder
impl Freeze for RuntimeBuilder
impl Send for RuntimeBuilder
impl Sync for RuntimeBuilder
impl Unpin for RuntimeBuilder
impl UnsafeUnpin for RuntimeBuilder
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