pub trait ToNdjson: Serialize {
// Provided methods
fn to_ndjson_writer(&self, writer: impl Write) -> Result<()> { ... }
fn to_ndjson_vec(&self) -> Result<Vec<u8>> { ... }
}
Expand description
Write a STAC object to newline-delimited JSON.
Provided Methods§
Sourcefn to_ndjson_writer(&self, writer: impl Write) -> Result<()>
fn to_ndjson_writer(&self, writer: impl Write) -> Result<()>
Writes a value to a writer as newline-delimited JSON.
§Examples
use stac::{ToNdjson, ItemCollection, Item};
let item_collection: ItemCollection = vec![Item::new("a"), Item::new("b")].into();
let mut buf = Vec::new();
item_collection.to_ndjson_writer(&mut buf).unwrap();
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.