pub struct DeviceSupervisor;Expand description
Typed SupervisorOf<ContextActor> adapter for DeviceActor.
atomr 0.2.0 added the [SupervisorOf] trait so a parent can decide
child failures by pattern-matching a typed error rather than parsing
the panic-string. The implementation here lives behind the
[device_supervisor] zero-sized type so it can be used either
independently (DeviceSupervisor.decide(&err)) or attached to
future call sites that take a SupervisorOf<C> constraint.
We attach the impl to a marker rather than directly to DeviceActor
so that the error module stays free of a circular dependency on
device::DeviceActor / device::ContextActor. The decision logic
is identical to the closure in decider — and indeed
DeviceSupervisor::decide_str is what the closure-based code path
internally calls.
Implementations§
Source§impl DeviceSupervisor
impl DeviceSupervisor
Sourcepub fn decide(err: &GpuError) -> Directive
pub fn decide(err: &GpuError) -> Directive
Typed decider over &GpuError. Mirrors the panic-string match
in decider.
Sourcepub fn decide_str(panic_msg: &str) -> Directive
pub fn decide_str(panic_msg: &str) -> Directive
Convenience: decide directly from the panic-string transport.
Equivalent to invoking decider but available as a free
function for callers who already have the panic message in
hand.
Trait Implementations§
Source§impl<C> SupervisorOf<C> for DeviceSupervisorwhere
C: Actor,
Blanket SupervisorOf<C> impl: any atomr actor C whose failures
the application classifies as GpuError can be supervised by
this marker. The trait’s decide method dispatches to
DeviceSupervisor::decide.
impl<C> SupervisorOf<C> for DeviceSupervisorwhere
C: Actor,
Blanket SupervisorOf<C> impl: any atomr actor C whose failures
the application classifies as GpuError can be supervised by
this marker. The trait’s decide method dispatches to
DeviceSupervisor::decide.