use futures::stream::BoxStream;
use super::{Action, RuntimeDirectives};
#[must_use = "Runtime command parts may contain side effects and directives that must be handled by the runtime."]
pub struct RuntimeCommandParts<Msg: Send + 'static> {
directives: RuntimeDirectives,
stream: Option<BoxStream<'static, Action<Msg>>>,
}
impl<Msg: Send + 'static> RuntimeCommandParts<Msg> {
pub(super) const fn new(
directives: RuntimeDirectives,
stream: Option<BoxStream<'static, Action<Msg>>>,
) -> Self {
Self { directives, stream }
}
pub(crate) const fn requests_redraw(&self) -> bool {
self.directives.requests_redraw()
}
pub(crate) fn into_stream(self) -> Option<BoxStream<'static, Action<Msg>>> {
self.stream
}
}