events: Ensure that all public items are documented
This commit is contained in:
parent
5907544166
commit
bc48eb2162
@ -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>;
|
||||
|
@ -100,6 +100,8 @@
|
||||
//! ));
|
||||
//! ```
|
||||
|
||||
#![warn(missing_docs)]
|
||||
|
||||
use std::{collections::BTreeSet, fmt};
|
||||
|
||||
use ruma_common::{EventEncryptionAlgorithm, OwnedUserId, RoomVersionId};
|
||||
|
@ -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 }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user