pub fn ndjson_iter<I, T>(iter: I) -> ResponseExpand description
Create an NDJSON response from an iterator.
This is a convenience function for when you have an iterator rather than a stream.
§Example
ⓘ
use fastapi_core::ndjson::ndjson_iter;
use serde::Serialize;
#[derive(Serialize)]
struct User { id: i64, name: String }
let users = vec![
User { id: 1, name: "Alice".into() },
User { id: 2, name: "Bob".into() },
];
let response = ndjson_iter(users);