IcarusServer

Trait IcarusServer 

Source
pub trait IcarusServer:
    ServerHandler
    + Send
    + Sync {
    // Required method
    fn register_tool(&mut self, tool: Box<dyn IcarusTool>) -> Result<()>;

    // Provided methods
    fn on_canister_init<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_canister_upgrade<'life0, 'async_trait>(
        &'life0 mut self,
        _from_version: Version,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_pre_upgrade<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_post_upgrade<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn canister_id(&self) -> Option<Principal> { ... }
}
Expand description

Core trait for Icarus MCP servers that extends rmcp’s ServerHandler

Required Methods§

Source

fn register_tool(&mut self, tool: Box<dyn IcarusTool>) -> Result<()>

Register a tool with the server

Provided Methods§

Source

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

Called when the canister is first initialized

Source

fn on_canister_upgrade<'life0, 'async_trait>( &'life0 mut self, _from_version: Version, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called during canister upgrades

Source

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

Called before canister upgrade to save state

Source

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

Called after canister upgrade to restore state

Source

fn canister_id(&self) -> Option<Principal>

Get the canister principal

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.

Implementors§