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§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
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.