Struct DeviceRegistry
pub struct DeviceRegistry { /* private fields */ }Implementations§
Source§impl DeviceRegistry
impl DeviceRegistry
Sourcepub fn register(
&mut self,
board_name: &str,
vid: Option<u16>,
pid: Option<u16>,
device_path: Option<String>,
architecture: Option<String>,
) -> String
pub fn register( &mut self, board_name: &str, vid: Option<u16>, pid: Option<u16>, device_path: Option<String>, architecture: Option<String>, ) -> String
Register a discovered device and assign a stable alias.
Returns the assigned alias (e.g. "pico0").
Sourcepub fn attach_transport(
&mut self,
alias: &str,
transport: Arc<dyn Transport>,
capabilities: DeviceCapabilities,
) -> Result<()>
pub fn attach_transport( &mut self, alias: &str, transport: Arc<dyn Transport>, capabilities: DeviceCapabilities, ) -> Result<()>
Attach a transport and capabilities to a previously registered device.
Returns Err when alias is not found in the registry (should not
happen in normal usage because callers pass aliases from register).
Sourcepub fn context(&self, alias: &str) -> Option<DeviceContext>
pub fn context(&self, alias: &str) -> Option<DeviceContext>
Build a DeviceContext for a device by alias.
Returns None if the alias is unknown or no transport is attached.
Sourcepub fn prompt_summary(&self) -> String
pub fn prompt_summary(&self) -> String
Return a summary of connected devices for the LLM system prompt.
pub fn resolve_gpio_device( &self, args: &Value, ) -> Result<(String, DeviceContext), String>
Sourcepub fn has_aardvark(&self) -> bool
pub fn has_aardvark(&self) -> bool
Return true when at least one Aardvark adapter is registered.
pub fn resolve_aardvark_device( &self, args: &Value, ) -> Result<(String, DeviceContext), String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeviceRegistry
impl !RefUnwindSafe for DeviceRegistry
impl Send for DeviceRegistry
impl Sync for DeviceRegistry
impl Unpin for DeviceRegistry
impl UnsafeUnpin for DeviceRegistry
impl !UnwindSafe for DeviceRegistry
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more