pub struct TransformRecipeLoader { /* private fields */ }Expand description
Loader for .yah/qed/transforms/*.toml files.
Kept separate from PipelineLoader (in yah-qed) per W164
OQ#1: pipelines and transforms have different IO contracts and conflating
them in one loader forces every pipeline to branch on “is this actually a
transform?”.
Implementations§
Source§impl TransformRecipeLoader
impl TransformRecipeLoader
Sourcepub fn new(transforms_dir: impl AsRef<Path>) -> TransformRecipeLoader
pub fn new(transforms_dir: impl AsRef<Path>) -> TransformRecipeLoader
Construct a loader rooted at the transforms directory
(conventionally <workspace>/.yah/qed/transforms).
Sourcepub fn recipe_path(&self, name: &str) -> PathBuf
pub fn recipe_path(&self, name: &str) -> PathBuf
Path the recipe with the given name would live at.
Sourcepub fn list_all(&self) -> Result<Vec<String>, RecipeError>
pub fn list_all(&self) -> Result<Vec<String>, RecipeError>
List every recipe name (the *.toml file stem) in the transforms dir,
sorted. Mirrors PipelineLoader::list_all — scans the
directory on each call so a freshly-dropped recipe surfaces without a
daemon restart. A missing transforms dir is not an error: it yields an
empty list (a camp may legitimately define no transforms).
Sourcepub fn load(&self, name: &str) -> Result<TransformRecipe, RecipeError>
pub fn load(&self, name: &str) -> Result<TransformRecipe, RecipeError>
Load and validate a recipe by name. The two post-parse rules:
recipe.namemust match the requested name (catches typos / rename accidents).recipe.image.digestmust beSome(digest-pin enforcement; the string-form deserializer enforces this forimage = "...", this catches the legacy struct form too).
Sourcepub fn load_from_path(
&self,
path: &Path,
) -> Result<TransformRecipe, RecipeError>
pub fn load_from_path( &self, path: &Path, ) -> Result<TransformRecipe, RecipeError>
Read + parse + validate a recipe at an explicit path. Lower-level than
Self::load; useful when callers already know the file location
(tests, single-recipe materialize paths).
Auto Trait Implementations§
impl Freeze for TransformRecipeLoader
impl RefUnwindSafe for TransformRecipeLoader
impl Send for TransformRecipeLoader
impl Sync for TransformRecipeLoader
impl Unpin for TransformRecipeLoader
impl UnsafeUnpin for TransformRecipeLoader
impl UnwindSafe for TransformRecipeLoader
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more