pub struct AppState {
pub html_content: RwLock<String>,
pub reload_tx: Sender<ReloadEvent>,
pub is_building: RwLock<bool>,
pub args: ModeArgs,
}Expand description
Shared application state.
Holds the generated HTML, reload channel, build lock, and CLI arguments for coordination between the HTTP server and file watcher.
Fields§
§html_content: RwLock<String>The generated HTML with injected reload script.
reload_tx: Sender<ReloadEvent>Broadcast channel for reload events.
is_building: RwLock<bool>Whether a build is currently in progress.
args: ModeArgsCLI arguments.
Implementations§
Source§impl AppState
impl AppState
pub fn get_html_content(&self) -> &RwLock<String>
pub fn get_mut_html_content(&mut self) -> &mut RwLock<String>
pub fn set_html_content(&mut self, val: RwLock<String>) -> &mut Self
pub fn get_reload_tx(&self) -> &Sender<ReloadEvent>
pub fn get_mut_reload_tx(&mut self) -> &mut Sender<ReloadEvent>
pub fn set_reload_tx(&mut self, val: Sender<ReloadEvent>) -> &mut Self
pub fn get_is_building(&self) -> &RwLock<bool>
pub fn get_mut_is_building(&mut self) -> &mut RwLock<bool>
pub fn set_is_building(&mut self, val: RwLock<bool>) -> &mut Self
pub fn get_args(&self) -> &ModeArgs
pub fn get_mut_args(&mut self) -> &mut ModeArgs
pub fn set_args(&mut self, val: ModeArgs) -> &mut Self
Auto Trait Implementations§
impl !Freeze for AppState
impl !RefUnwindSafe for AppState
impl !UnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendSync for T
impl<T> AnySync for T
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