pub struct HookCfg {
pub when: HookWhen,
pub os: Option<HookOs>,
pub run: String,
pub inputs: Vec<String>,
pub outputs: Vec<String>,
}Expand description
One [[hooks]] entry: an app-declared build/setup command.
[[hooks]]
when = "prebuild"
os = "linux"
run = "cc -shared -fPIC -O2 -o libmd.so md.c"
inputs = ["md.c"]
outputs = ["libmd.so"]when and run are required; os, inputs, and outputs are optional
and default empty/absent. Validated at parse time by the custom
Deserialize impl below, so a bad when / os value or an empty run
surfaces as a lumen.toml parse error naming the offending value and the
accepted set, rather than failing later at hook-run time.
Hooks execute arbitrary shell commands read from a file inside the app directory - the same trust model as a Cargo build script. `lumenc run
Fields§
§when: HookWhenTrigger point: prebuild or prerun.
os: Option<HookOs>Restrict the hook to one OS. None runs on every platform.
run: StringThe command line, run via sh -c (unix) or cmd /C (windows) with
the app directory as the child’s cwd.
inputs: Vec<String>Files the command reads, relative to the app directory unless
absolute. Used only for the staleness check; never passed to run.
outputs: Vec<String>Files the command produces, relative to the app directory unless absolute. Used only for the staleness check.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HookCfg
impl<'de> Deserialize<'de> for HookCfg
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl Eq for HookCfg
impl StructuralPartialEq for HookCfg
Auto Trait Implementations§
impl Freeze for HookCfg
impl RefUnwindSafe for HookCfg
impl Send for HookCfg
impl Sync for HookCfg
impl Unpin for HookCfg
impl UnsafeUnpin for HookCfg
impl UnwindSafe for HookCfg
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DynEq for T
impl<T> DynEq for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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