pub struct Config<Ctx = HtmlCtx>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 = HtmlCtx> !RefUnwindSafe for Config<Ctx>
impl<Ctx> Send for Config<Ctx>where Ctx: Send,
impl<Ctx = HtmlCtx> !Sync for Config<Ctx>
impl<Ctx> Unpin for Config<Ctx>where Ctx: Unpin,
impl<Ctx = HtmlCtx> !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
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>
§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.