spring::plugin::service

Trait Service

Source
pub trait Service: Clone + Sized {
    // Required method
    fn build(app: &AppBuilder) -> Result<Self>;
}
Expand description

Service is a special Component that can inject dependent Components as field members

use spring::plugin::service::Service;
use spring_sqlx::ConnectPool;

#[derive(Clone, Service)]
struct UserService {
    #[component]
    db: ConnectPool
}

Required Methods§

Source

fn build(app: &AppBuilder) -> Result<Self>

Construct the Service component

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§