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§
Sourcefn register_tool(&mut self, tool: Box<dyn IcarusTool>) -> Result<()>
fn register_tool(&mut self, tool: Box<dyn IcarusTool>) -> Result<()>
Register a tool with the server
Provided Methods§
Sourcefn 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_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
Sourcefn 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_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
Sourcefn 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_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
Sourcefn 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 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
Sourcefn canister_id(&self) -> Option<Principal>
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.