Struct zng_ext_hot_reload::BuildArgs
source · pub struct BuildArgs {
pub manifest_dir: Txt,
pub cancel_build: SignalOnce,
}
Expand description
Arguments for custom rebuild runners.
See HOT_RELOAD.rebuilder
for more details.
Fields§
§manifest_dir: Txt
Crate that changed.
cancel_build: SignalOnce
Cancel signal.
If the build cannot be cancelled or has already finished this signal must be ignored and the normal result returned.
Implementations§
source§impl BuildArgs
impl BuildArgs
sourcepub fn build(
&self,
package: Option<&str>,
) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
pub fn build( &self, package: Option<&str>, ) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
Calls cargo build [--package {package}] --message-format json
and cancels it as soon as the dylib is rebuilt.
Always returns Some(_)
.
sourcepub fn build_example(
&self,
package: Option<&str>,
example: &str,
) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
pub fn build_example( &self, package: Option<&str>, example: &str, ) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
Calls cargo build [--package {package}] --example {example} --message-format json
and cancels
it as soon as the dylib is rebuilt.
Always returns Some(_)
.
sourcepub fn build_bin(
&self,
package: Option<&str>,
bin: &str,
) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
pub fn build_bin( &self, package: Option<&str>, bin: &str, ) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
Calls cargo build [--package {package}] --bin {bin} --message-format json
and cancels it as
soon as the dylib is rebuilt.
Always returns Some(_)
.
sourcepub fn build_manifest(
&self,
path: &str,
) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
pub fn build_manifest( &self, path: &str, ) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
Calls cargo build --manifest-path {path} --message-format json
and cancels it as soon as the dylib is rebuilt.
Always returns Some(_)
.
sourcepub fn custom(
&self,
cmd: Command,
) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
pub fn custom( &self, cmd: Command, ) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
Calls a custom command that must write to stdout the same way cargo build --message-format json
does.
The command will run until it writes the "compiler-artifact"
for the manifest_dir/Cargo.toml
to stdout, it will
then be killed.
Always returns Some(_)
.
sourcepub fn custom_env(
&self,
var_key: &str,
) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
pub fn custom_env( &self, var_key: &str, ) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
Call a custom command defined in an environment var.
The variable value must be arguments for cargo
, that is cargo $VAR
.
See custom
for other requirements of the command.
If var_key
is empty the default key "ZNG_HOT_RELOAD_REBUILDER"
is used.
Returns None
if the var is not found or is set empty.
sourcepub fn default_build(&self) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
pub fn default_build(&self) -> Option<ResponseVar<Result<PathBuf, BuildError>>>
The default action.
Tries custom_env
, if env is not set, does build(None)
.
Always returns Some(_)
.
Trait Implementations§
impl StructuralPartialEq for BuildArgs
Auto Trait Implementations§
impl Freeze for BuildArgs
impl !RefUnwindSafe for BuildArgs
impl Send for BuildArgs
impl Sync for BuildArgs
impl Unpin for BuildArgs
impl !UnwindSafe for BuildArgs
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self
equals other
.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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§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