Skip to main content

CapabilityClient

Trait CapabilityClient 

Source
pub trait CapabilityClient: Sized + 'static {
    type Dependencies: ?Sized;
    type Error;

    const CAPABILITY_ID: &'static str;
    const DESCRIPTOR_VERSION: &'static str;

    // Required methods
    fn from_dependencies(
        dependencies: &Self::Dependencies,
    ) -> Result<Self, Self::Error>;
    fn already_connected() -> Self::Error;
}
Expand description

A generated, strongly typed client for one required Capability.

Capability binding generators implement this trait for their client type so Plugin authoring frontends can connect typed Ports without knowing the Capability’s operation kinds or handle layout. Implementations must use only the supplied Plan-owned dependencies; they must not perform discovery.

Required Associated Constants§

Source

const CAPABILITY_ID: &'static str

Stable Capability identity required by this client.

Source

const DESCRIPTOR_VERSION: &'static str

Exact Descriptor version understood by this generated client.

Required Associated Types§

Source

type Dependencies: ?Sized

Adapter-owned dependency view used to connect this client.

Source

type Error

Adapter-owned failure returned when connection cannot complete.

Required Methods§

Source

fn from_dependencies( dependencies: &Self::Dependencies, ) -> Result<Self, Self::Error>

Connects this client to one Plugin Instance’s resolved dependencies.

Source

fn already_connected() -> Self::Error

Creates the adapter failure for an invalid second connection attempt.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§