Skip to main content

IntoStreamItem

Trait IntoStreamItem 

Source
pub trait IntoStreamItem: Send {
    // Required method
    fn into_stream_item(self) -> Result<String, String>;
}
Expand description

Trait for converting stream items into JSON strings.

Parallel to IntoHandlerResult but for individual stream messages.

Required Methods§

Source

fn into_stream_item(self) -> Result<String, String>

Convert this value into a JSON string for streaming.

Implementations on Foreign Types§

Source§

impl IntoStreamItem for String

String passes through verbatim.

Source§

impl<T: Serialize + Send, E: Display + Send> IntoStreamItem for Result<T, E>

Result<T, E> serializes Ok(T) to JSON and stringifies Err(E).

Implementors§

Source§

impl<T: Serialize + Send> IntoStreamItem for Json<T>

Json<T> auto-serializes to JSON.