use std::future::Future;
use facet::Facet;
use serde::{Deserialize, Serialize};
use crate::{Command, Request, capability::Operation, command::NotificationBuilder};
#[allow(clippy::unsafe_derive_deserialize)]
#[derive(Facet, Clone, Serialize, Deserialize, Debug, PartialEq, Eq)]
pub struct RenderOperation;
impl Operation for RenderOperation {
type Output = ();
}
#[must_use]
pub fn render_builder<Effect, Event>()
-> NotificationBuilder<Effect, Event, impl Future<Output = ()>>
where
Effect: From<Request<RenderOperation>> + Send + 'static,
Event: Send + 'static,
{
Command::notify_shell(RenderOperation)
}
pub fn render<Effect, Event>() -> Command<Effect, Event>
where
Effect: From<Request<RenderOperation>> + Send + 'static,
Event: Send + 'static,
{
render_builder().into()
}