pub trait CapabilityExt {
// Required methods
fn new(
id: String,
name: String,
capability_type: CapabilityType,
confidence: f32,
) -> Self;
fn get_capability_type(&self) -> CapabilityType;
fn set_capability_type(&mut self, capability_type: CapabilityType);
fn is_valid(&self, threshold: f32) -> bool;
}Expand description
Extension trait for Capability with ergonomic constructors and accessors
Required Methods§
Sourcefn new(
id: String,
name: String,
capability_type: CapabilityType,
confidence: f32,
) -> Self
fn new( id: String, name: String, capability_type: CapabilityType, confidence: f32, ) -> Self
Create a new capability
§Arguments
id- Unique capability identifiername- Human-readable namecapability_type- Type of capability (sensor, compute, etc.)confidence- Confidence score (0.0 - 1.0), will be clamped
Sourcefn get_capability_type(&self) -> CapabilityType
fn get_capability_type(&self) -> CapabilityType
Get the capability type as the enum (not i32)
Returns the CapabilityType enum value, converting from the protobuf i32 field. Returns Unspecified if the field contains an invalid value.
Sourcefn set_capability_type(&mut self, capability_type: CapabilityType)
fn set_capability_type(&mut self, capability_type: CapabilityType)
Set the capability type from the enum
§Arguments
capability_type- The CapabilityType enum value to set
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.