events: Ensure that all public items are documented

This commit is contained in:
Jonas Platte 2023-09-20 11:52:25 +02:00
parent 5907544166
commit bc48eb2162
No known key found for this signature in database
GPG Key ID: AAA7A61F696C3E0C
3 changed files with 7 additions and 0 deletions

View File

@ -22,6 +22,7 @@ pub trait EventContent: Sized + Serialize {
fn event_type(&self) -> Self::EventType;
}
/// Extension trait for [`Raw<T>`].
pub trait RawExt<T: EventContentFromType> {
/// Try to deserialize the JSON as an event's content with the given event type.
fn deserialize_with_type(&self, event_type: T::EventType) -> serde_json::Result<T>;

View File

@ -100,6 +100,8 @@
//! ));
//! ```
#![warn(missing_docs)]
use std::{collections::BTreeSet, fmt};
use ruma_common::{EventEncryptionAlgorithm, OwnedUserId, RoomVersionId};

View File

@ -945,6 +945,9 @@ impl<C> TryFrom<Relation<C>> for RelationWithoutReplacement {
}
}
/// Metadata about an event to be replaced.
///
/// To be used with [`RoomMessageEventContent::make_replacement`].
#[derive(Debug)]
pub struct ReplacementMetadata {
event_id: OwnedEventId,
@ -952,6 +955,7 @@ pub struct ReplacementMetadata {
}
impl ReplacementMetadata {
/// Creates a new `ReplacementMetadata` with the given event ID and mentions.
pub fn new(event_id: OwnedEventId, mentions: Option<Mentions>) -> Self {
Self { event_id, mentions }
}