pub trait Streamable: StreamEncoder {
const NAME: &'static str;
const WILDCARD_LIST: &'static [&'static str];
}
Expand description
Trait for types that can be streamed.
§Examples
use async_trait::async_trait;
use fuel_streams_core::prelude::*;
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
struct MyStreamable {
data: String,
}
impl StreamEncoder for MyStreamable {}
#[async_trait]
impl Streamable for MyStreamable {
const NAME: &'static str = "my_streamable";
const WILDCARD_LIST: &'static [&'static str] = &["*"];
}
Required Associated Constants§
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.