pub enum Output {
Immediate(Immediate),
Stream(OutputStream),
}Expand description
The Output enum provides a general interface for outputs of different types.
The Immediate variant represents data that is immediately available, while the Stream variant
represents data that may be produced over time.
Variants§
Immediate(Immediate)
Represents immediately available data.
Stream(OutputStream)
Represents data that is produced over time.
Implementations§
source§impl Output
impl Output
sourcepub async fn to_immediate(self) -> Result<Immediate, ExecutorError>
pub async fn to_immediate(self) -> Result<Immediate, ExecutorError>
Converts the Output to its Immediate form.
If the output is Stream, it will be consumed and turned into an Immediate output.
This operation is asynchronous as it may need to wait for all data to be produced in the case of a Stream.
sourcepub fn new_stream() -> (Sender<StreamSegment>, Self)
pub fn new_stream() -> (Sender<StreamSegment>, Self)
Creates a new Stream output along with a sender to produce data.
pub fn from_stream<S>(stream: S) -> Selfwhere S: Stream<Item = StreamSegment> + Send + 'static,
sourcepub fn new_immediate(data: Data<String>) -> Self
pub fn new_immediate(data: Data<String>) -> Self
Creates a new Immediate output from the given data.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Output
impl Send for Output
impl Sync for Output
impl Unpin for Output
impl !UnwindSafe for Output
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more