pub struct Supervisor {
pub spec: Spec,
/* private fields */
}Expand description
One plugin, kept running.
Fields§
§spec: SpecImplementations§
Source§impl Supervisor
impl Supervisor
Sourcepub fn new(
spec: Spec,
ctx: Context,
max_restarts: u32,
grant: impl FnMut(&Hello) -> Grants + Send + 'static,
) -> Self
pub fn new( spec: Spec, ctx: Context, max_restarts: u32, grant: impl FnMut(&Hello) -> Grants + Send + 'static, ) -> Self
max_restarts is the plugins.max_restarts preference.
pub fn with_restarts( spec: Spec, ctx: Context, restarts: Restarts, grant: impl FnMut(&Hello) -> Grants + Send + 'static, ) -> Self
Sourcepub fn with_notify(
spec: Spec,
ctx: Context,
restarts: Restarts,
notify: Notify,
grant: impl FnMut(&Hello) -> Grants + Send + 'static,
) -> Self
pub fn with_notify( spec: Spec, ctx: Context, restarts: Restarts, notify: Notify, grant: impl FnMut(&Hello) -> Grants + Send + 'static, ) -> Self
Like Supervisor::new, with a callback for arriving messages; it is
set before the first start.
pub fn state(&self) -> &State
pub fn connection(&self) -> Option<&Connection>
Sourcepub fn send(&mut self, m: &In, now: Instant) -> bool
pub fn send(&mut self, m: &In, now: Instant) -> bool
Send a message; a broken pipe counts as a crash.
Sourcepub fn poll(&mut self, now: Instant) -> Vec<Out>
pub fn poll(&mut self, now: Instant) -> Vec<Out>
Drain the plugin’s messages and handle crashes and restarts. Call it
every frame or when woken. StateSave is kept here for the restart.
Auto Trait Implementations§
impl !RefUnwindSafe for Supervisor
impl !Sync for Supervisor
impl !UnwindSafe for Supervisor
impl Forget for Supervisor
impl Freeze for Supervisor
impl Send for Supervisor
impl Unpin for Supervisor
impl UnsafeUnpin for Supervisor
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