Struct zng::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<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<Result<PathBuf, BuildError>>>>>
pub fn build( &self, package: Option<&str>, ) -> Option<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<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<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<Result<PathBuf, BuildError>>>>>
pub fn build_example( &self, package: Option<&str>, example: &str, ) -> Option<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<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<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<Result<PathBuf, BuildError>>>>>
pub fn build_bin( &self, package: Option<&str>, bin: &str, ) -> Option<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<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<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<Result<PathBuf, BuildError>>>>>
pub fn build_manifest( &self, path: &str, ) -> Option<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<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<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<Result<PathBuf, BuildError>>>>>
pub fn custom( &self, cmd: Command, ) -> Option<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<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<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<Result<PathBuf, BuildError>>>>>
pub fn custom_env( &self, var_key: &str, ) -> Option<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<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<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<Result<PathBuf, BuildError>>>>>
pub fn default_build( &self, ) -> Option<ReadOnlyVar<Response<Result<PathBuf, BuildError>>, ArcVar<Response<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§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
)§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
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> 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