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§
Sourcefn into_stream_item(self) -> Result<String, String>
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.
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).
impl<T: Serialize + Send, E: Display + Send> IntoStreamItem for Result<T, E>
Result<T, E> serializes Ok(T) to JSON and stringifies Err(E).