Skip to main content

EndpointRegistry

Trait EndpointRegistry 

Source
pub trait EndpointRegistry:
    Send
    + Sync
    + Debug {
    // Required methods
    fn register<'life0, 'async_trait>(
        &'life0 self,
        binding: EndpointBinding,
    ) -> Pin<Box<dyn Future<Output = Result<(), CompileError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn resolve<'life0, 'life1, 'async_trait>(
        &'life0 self,
        endpoint_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<EndpointBinding>, CompileError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<EndpointBinding>, CompileError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Endpoint routing registry abstraction.

Stage 06 uses this to register A2A endpoints. The InMemoryEndpointRegistry stores bindings locally; future implementations can use service meshes or distributed registries.

Required Methods§

Source

fn register<'life0, 'async_trait>( &'life0 self, binding: EndpointBinding, ) -> Pin<Box<dyn Future<Output = Result<(), CompileError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Register an endpoint binding.

Source

fn resolve<'life0, 'life1, 'async_trait>( &'life0 self, endpoint_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<EndpointBinding>, CompileError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolve an endpoint by ID. Returns None if not found.

Source

fn list<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<EndpointBinding>, CompileError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all registered endpoint bindings.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§