Trait Service

Source
pub trait Service:
    Sized
    + Send
    + 'static {
    type Init: Clone + Send;
    type Input: Send;
    type Event: Send;
    type Output: Clone + 'static + Send;

    const DISABLE_EVENTS: bool = false;
    const LOCAL: bool = false;

    // Required method
    fn new(
        init: Self::Init,
        input_sender: Sender<Self::Input>,
        output_sender: Sender<Self::Output>,
    ) -> impl Future<Output = Self> + Send;

    // Provided methods
    fn handler(init: Self::Init) -> ServiceManager<Self> { ... }
    fn message(
        &mut self,
        _input: Self::Input,
        _output_sender: &Sender<Self::Output>,
    ) -> impl Future<Output = ()> + Send { ... }
    fn event_generator(&mut self) -> impl Future<Output = Self::Event> + Send { ... }
    fn event_handler(
        &mut self,
        _event: Self::Event,
        _output_sender: &Sender<Self::Output>,
    ) -> impl Future<Output = Result<(), Error>> + Send { ... }
}
Expand description

Trait that Azalea services must implement

Provided Associated Constants§

Source

const DISABLE_EVENTS: bool = false

Source

const LOCAL: bool = false

Required Associated Types§

Required Methods§

Source

fn new( init: Self::Init, input_sender: Sender<Self::Input>, output_sender: Sender<Self::Output>, ) -> impl Future<Output = Self> + Send

Provided Methods§

Source

fn handler(init: Self::Init) -> ServiceManager<Self>

Source

fn message( &mut self, _input: Self::Input, _output_sender: &Sender<Self::Output>, ) -> impl Future<Output = ()> + Send

Source

fn event_generator(&mut self) -> impl Future<Output = Self::Event> + Send

Source

fn event_handler( &mut self, _event: Self::Event, _output_sender: &Sender<Self::Output>, ) -> impl Future<Output = Result<(), Error>> + Send

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§

Source§

impl Service for azalea::shell::service::audio::Service

Source§

impl Service for azalea::shell::service::brightness::Service

Source§

impl Service for azalea::shell::service::dbus::bluez::Service

Source§

impl Service for azalea::shell::service::dbus::discovery::Service

Source§

impl Service for azalea::shell::service::dbus::login::Service

Source§

impl Service for azalea::shell::service::dbus::mpris::Service

Source§

impl Service for azalea::shell::service::dbus::network_manager::Service

Source§

impl Service for azalea::shell::service::dbus::notification::Service

Source§

impl Service for azalea::shell::service::search::Service

Source§

impl Service for azalea::shell::service::time::Service

Source§

impl Service for azalea::shell::service::weather::Service