Skip to main content

Module capability

Module capability 

Source
Expand description

Transforms:

#[pyroduct::capability]
impl StatefulServer {
    type Config = MyConfig;
    type Client = SimpleClient;
    type Error = MyError; // Optional

    fn new(config: &MyConfig) -> Self { Self }
    fn reset(&mut self) {}
    fn register(&self, _client: &SimpleClient) {}
    fn call(&self, _client: &SimpleClient) -> f32 { 42.0 }
}

Structs§

CapabilityImpl
Parsed capability from an impl block