Trait StreamEntry

Source
pub trait StreamEntry:
    Send
    + Sync
    + Serialize
    + for<'de> Deserialize<'de> {
    // Provided methods
    fn from_stream_id(stream_id: &StreamId) -> Result<Self, ParseError> { ... }
    fn xadd_map(&self) -> Result<BTreeMap<String, String>, ParseError> { ... }
}

Provided Methods§

Source

fn from_stream_id(stream_id: &StreamId) -> Result<Self, ParseError>

Deserializes from a stringified key value map but only if every field is FromStr. See serde_with::PickFirst<(_, serde_with::DisplayFromStr)>

Source

fn xadd_map(&self) -> Result<BTreeMap<String, String>, ParseError>

Serialize into a stringified field value mapping for XADD

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.

Implementors§

Source§

impl<T> StreamEntry for T
where T: Send + Sync + Serialize + for<'de> Deserialize<'de>,