pub struct Server {
pub cfm: SharedConfium,
pub dispatch: Dispatch,
pub cancel: CancellationToken,
}Expand description
The daemon’s shared state: the engine, the dispatch table, and a shutdown signal.
Fields§
§cfm: SharedConfiumThe single Confium instance owned by the daemon. All method handlers dispatch against this.
dispatch: DispatchMethod-name → handler table.
cancel: CancellationTokenCancellation token: set when shutdown is called or the process
receives a signal. Stops the accept loop and drains.
Implementations§
Source§impl Server
impl Server
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct a server with a fresh Confium (audit logger resolved from the environment) and the default dispatch table.
Sourcepub fn with_confium(cfm: Confium) -> Self
pub fn with_confium(cfm: Confium) -> Self
Construct a server with an explicit Confium (used by tests that want the audit logger disabled).
Sourcepub async fn serve_tcp(self: Rc<Self>, listener: TcpListener) -> Result<()>
pub async fn serve_tcp(self: Rc<Self>, listener: TcpListener) -> Result<()>
Run the accept loop on a TCP listener until shutdown. Must be
called from within a [LocalSet] — see Server::run_tcp.
Sourcepub async fn serve_unix(self: Rc<Self>, listener: UnixListener) -> Result<()>
pub async fn serve_unix(self: Rc<Self>, listener: UnixListener) -> Result<()>
Run the accept loop on a Unix socket listener until shutdown.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Server
impl !Send for Server
impl !Sync for Server
impl !UnwindSafe for Server
impl Freeze 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