pub struct Config<Ctx>where
Ctx: HotReloadingContext,{ /* private fields */ }
Implementations§
§impl<Ctx> Config<Ctx>where
Ctx: HotReloadingContext,
impl<Ctx> Config<Ctx>where Ctx: HotReloadingContext,
pub fn root(self, path: &'static str) -> Config<Ctx>
pub fn root(self, path: &'static str) -> Config<Ctx>
Set the root path of the project (where the Cargo.toml file is). This is automatically set by the [hot_reload_init
] macro.
pub fn with_logging(self, log: bool) -> Config<Ctx>
pub fn with_logging(self, log: bool) -> Config<Ctx>
Set whether to enable logs
pub fn with_rebuild_command(self, rebuild_command: &'static str) -> Config<Ctx>
pub fn with_rebuild_command(self, rebuild_command: &'static str) -> Config<Ctx>
Set the command to run to rebuild the project
For example to restart the application after a change is made, you could use cargo run
pub fn with_rebuild_callback(
self,
rebuild_callback: impl FnMut() -> bool + Send + 'static
) -> Config<Ctx>
pub fn with_rebuild_callback( self, rebuild_callback: impl FnMut() -> bool + Send + 'static ) -> Config<Ctx>
Set a callback to run to when the project needs to be rebuilt and returns if the server should shut down
For example a CLI application could rebuild the application when a change is made
pub fn with_paths(self, paths: &'static [&'static str]) -> Config<Ctx>
pub fn with_paths(self, paths: &'static [&'static str]) -> Config<Ctx>
Set the paths to listen for changes in to trigger hot reloading. If this is a directory it will listen for changes in all files in that directory recursively.
pub fn excluded_paths(self, paths: &'static [&'static str]) -> Config<Ctx>
pub fn excluded_paths(self, paths: &'static [&'static str]) -> Config<Ctx>
Sets paths to ignore changes on. This will override any paths set in the Config::with_paths
method in the case of conflicts.
Trait Implementations§
Auto Trait Implementations§
impl<Ctx> !RefUnwindSafe for Config<Ctx>
impl<Ctx> Send for Config<Ctx>where Ctx: Send,
impl<Ctx> !Sync for Config<Ctx>
impl<Ctx> Unpin for Config<Ctx>where Ctx: Unpin,
impl<Ctx> !UnwindSafe for Config<Ctx>
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert
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, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Convert
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)
Convert
&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)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§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>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere R: Read + ReadEndian<P>, P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.