pub struct AppState {
pub api: Arc<RwLock<WebApi>>,
pub optimization_status: Arc<RwLock<OptimizationStatus>>,
pub status_broadcast: Sender<OptimizationStatus>,
pub status_mpsc: UnboundedSender<OptimizationStatus>,
}Expand description
应用状态
Fields§
§api: Arc<RwLock<WebApi>>全局 WebApi 实例(使用 RwLock 支持异步并发)
optimization_status: Arc<RwLock<OptimizationStatus>>优化状态(使用 RwLock 支持异步并发)
status_broadcast: Sender<OptimizationStatus>WebSocket 广播发送器
status_mpsc: UnboundedSender<OptimizationStatus>MPSC 发送器(用于从同步回调发送)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl !RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
impl !UnwindSafe for AppState
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