pub struct Supervised { /* private fields */ }Expand description
A composable supervised service: drain controller + exit source + drain hooks.
Implementations§
Source§impl Supervised
impl Supervised
pub fn new() -> Self
pub fn drain_controller(&self) -> DrainController
pub fn exit<E>(self, source: E) -> Selfwhere
E: ExitSource + 'static,
pub fn signals(self) -> Self
pub fn on_drain<H>(self, hook: H) -> Selfwhere
H: DrainHook + 'static,
pub fn drain_budget(self, budget: Duration) -> Self
pub async fn serve_rpc_listener<H>(
self,
listener: Box<dyn WireListener>,
handler: Arc<H>,
) -> Result<()>where
H: RpcHandler + ?Sized + 'static,
pub async fn serve_rpc<H>(
self,
transport: &dyn Transport,
addr: &str,
handler: Arc<H>,
) -> Result<()>where
H: RpcHandler + ?Sized + 'static,
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Supervised
impl !UnwindSafe for Supervised
impl Freeze for Supervised
impl Send for Supervised
impl Sync for Supervised
impl Unpin for Supervised
impl UnsafeUnpin for Supervised
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