pub struct Server { /* private fields */ }Expand description
The running backend: a bound loopback listener plus the web root and the in-process stores shared across connection threads.
Implementations§
Source§impl Server
impl Server
Sourcepub fn bind(config: &ServerConfig) -> Result<Server, ServerError>
pub fn bind(config: &ServerConfig) -> Result<Server, ServerError>
Bind the loopback listener. Fails if the address/port is unavailable.
Sourcepub fn addr(&self) -> SocketAddr
pub fn addr(&self) -> SocketAddr
The actual bound address (useful when port 0 auto-assigns).
Sourcepub fn session_token(&self) -> &str
pub fn session_token(&self) -> &str
The 256-bit session token; shells inject it into the WebView memory.
Sourcepub fn request_shutdown(&self)
pub fn request_shutdown(&self)
Ask the accept loop to stop (used by the Tauri shell on exit).
Sourcepub fn shutdown_flag(&self) -> Arc<AtomicBool> ⓘ
pub fn shutdown_flag(&self) -> Arc<AtomicBool> ⓘ
The shutdown flag, for shells that need to set it from a handler
without holding the Server (e.g. a Tauri exit callback).
Sourcepub fn serve(&self) -> Result<()>
pub fn serve(&self) -> Result<()>
Serve the loopback API until a shutdown signal arrives (Ctrl-C/SIGTERM
or Server::request_shutdown). Blocking facade over the tokio
runtime; axum/hyper handle connections (M1-04).
Auto Trait Implementations§
impl Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
impl UnwindSafe for Server
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