pub struct Server { /* private fields */ }Expand description
A booted serve host, for a hosting target to wrap.
Implementations§
Source§impl Server
impl Server
Sourcepub fn builder(app: App, mode: Mode) -> ServerBuilder
pub fn builder(app: App, mode: Mode) -> ServerBuilder
Start building a server for app in mode.
Sourcepub fn new(app: App, mode: Mode, data_dir: Option<PathBuf>) -> Result<Self>
pub fn new(app: App, mode: Mode, data_dir: Option<PathBuf>) -> Result<Self>
Boot app in mode, persisting under data_dir (None keeps
everything in memory). Shorthand for Server::builder.
Sourcepub fn router(&self) -> Router
pub fn router(&self) -> Router
serve’s /v1 wire API (plus /health), to merge into a target’s
router.
Sourcepub fn busy(&self) -> bool
pub fn busy(&self) -> bool
Whether a turn is running right now. A turn parked on an approval or a question is not busy: nothing runs until a person answers.
Sourcepub fn default_agent(&self) -> Option<String>
pub fn default_agent(&self) -> Option<String>
The agent a request lands on when it names none: the default agent,
or the only top-level one.
Sourcepub fn spawn_schedules(&self)
pub fn spawn_schedules(&self)
Run the app’s #[schedule]s in-process, as dev and start do.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Server
impl !UnwindSafe for Server
impl Freeze for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin 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