pub enum EventRefs {
Hashed(Vec<HashedEventRef>),
Plain(Vec<OwnedEventId>),
Empty,
}Expand description
Event references in a room-version-specific format.
Variants§
Hashed(Vec<HashedEventRef>)
V1/V2 format: event IDs with content hashes
[["$id", {"sha256": "hash"}]].
Plain(Vec<OwnedEventId>)
V3+ format: event IDs only ["$id"].
Empty
Empty list of references, so we do not care about the version
Implementations§
Source§impl EventRefs
impl EventRefs
Sourcepub fn event_ids(
&self,
) -> Box<dyn Iterator<Item = &OwnedEventId> + Send + Sync + '_>
pub fn event_ids( &self, ) -> Box<dyn Iterator<Item = &OwnedEventId> + Send + Sync + '_>
Returns an iterator over the event IDs, regardless of format.
Sourcepub(crate) fn pdu_deserialize<'de, D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
pub(crate) fn pdu_deserialize<'de, D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
A deserializer for EventRefs which return the empty variant when empty
Sourcepub(crate) fn pdu_serialize(&self) -> Value
pub(crate) fn pdu_serialize(&self) -> Value
Serialize event refs in the format expected of a PDU
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EventRefs
impl<'de> Deserialize<'de> for EventRefs
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for EventRefs
impl StructuralPartialEq for EventRefs
Auto Trait Implementations§
impl Freeze for EventRefs
impl RefUnwindSafe for EventRefs
impl Send for EventRefs
impl Sync for EventRefs
impl Unpin for EventRefs
impl UnsafeUnpin for EventRefs
impl UnwindSafe for EventRefs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.