Skip to main content

PluginContext

Struct PluginContext 

Source
pub struct PluginContext {
Show 26 fields pub plugin_id: String, pub plugin_version: String, pub agent_id: String, pub data_dir: Option<PathBuf>, pub events: EventsClient, pub mavlink: MavlinkClient, pub msp: MspClient, pub telemetry: TelemetryClient, pub peripheral_manager: PeripheralClient, pub peripherals: PeripheralClient, pub camera: CameraClient, pub vision: VisionClient, pub config: ConfigClient, pub buttons: ButtonClient, pub flight: FlightClient, pub gpio: GpioClient, pub display: DisplayClient, pub radio: RadioClient, pub cloud: CloudClient, pub node: NodeClient, pub mdns: MdnsClient, pub video: VideoClient, pub sensors: SensorsClient, pub process: ProcessClient, pub lifecycle: LifecycleClient, pub tools: ToolsClient, /* private fields */
}
Expand description

The object handed to every lifecycle hook. Every host-facing surface is a capability-gated facade; the IPC client is an implementation detail.

Ports ados.plugins.ipc.context.PluginContext. The peripherals field is an alias for peripheral_manager, matching the Python back-compat alias.

Fields§

§plugin_id: String§plugin_version: String§agent_id: String§data_dir: Option<PathBuf>

The plugin’s per-drone data directory, when the host set one on the unit. None on a host that did not — a plugin must handle its absence rather than assume a path.

§events: EventsClient§mavlink: MavlinkClient§msp: MspClient

ctx.msp — raw MSP read/write for a Betaflight / iNav / KISS FC.

§telemetry: TelemetryClient§peripheral_manager: PeripheralClient§peripherals: PeripheralClient

Alias for peripheral_manager (Python ctx.peripherals).

§camera: CameraClient§vision: VisionClient

ctx.vision — subscribe to engine frames, register models, run inference, publish detections, and inject visual-odometry pose.

§config: ConfigClient§buttons: ButtonClient

Front-panel button presses; quiet on a board with no panel.

§flight: FlightClient

The scoped guided-setpoint sender.

§gpio: GpioClient

Host GPIO output (status line, buzzer).

§display: DisplayClient

The reserved data-driven display page.

§radio: RadioClient

The additive auxiliary radio stream.

§cloud: CloudClient

The plugin’s cloud stream and cloud records.

§node: NodeClient

Facts about this node: profile, board, ground-station role, camera.

§mdns: MdnsClient

Local-network service discovery through the host’s mDNS responder.

§video: VideoClient

WebRTC playback sessions on the agent’s camera legs.

§sensors: SensorsClient

The sensor rig document.

§process: ProcessClient§lifecycle: LifecycleClient§tools: ToolsClient

The plugin’s MCP tool handler registration.

Implementations§

Source§

impl PluginContext

Source

pub fn new( ipc: Arc<PluginIpcClient>, plugin_version: impl Into<String>, agent_id: impl Into<String>, data_dir: Option<String>, static_config: BTreeMap<String, Value>, ) -> Self

Build a context over a connected client. static_config is the manifest-supplied config dict the runner read at start.

Source

pub async fn ping_supervisor(&self) -> Result<Value, ClientError>

Health probe against the host. Mirrors ping_supervisor.

Source

pub fn client(&self) -> &Arc<PluginIpcClient> ⓘ

The shared client, for advanced callers that need a method not yet on a facade.

Trait Implementations§

Source§

impl Clone for PluginContext

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more