#[non_exhaustive]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 (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.manifest_dir: TxtCrate that changed.
cancel_build: SignalOnceCancel 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 T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
other if both are of the same type.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§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