events: Improve extensible events conversion helpers docs

This commit is contained in:
Kévin Commaille 2022-07-02 17:47:44 +02:00 committed by Kévin Commaille
parent be2310294a
commit a4e6081b41
4 changed files with 8 additions and 6 deletions

View File

@ -209,7 +209,7 @@ impl FileContentInfo {
/// Create a new `FileContentInfo` with the given filename, mimetype and size.
///
/// Returns `None` if all parameters are `None`.
/// Returns `None` if the `FileContentInfo` would be empty.
pub(crate) fn from_room_message_content(
filename: Option<String>,
mimetype: Option<String>,

View File

@ -163,7 +163,7 @@ impl ImageContent {
/// Creates a new `ImageContent` with the given optional width and height.
///
/// Returns `None` if both parameters are `None`.
/// Returns `None` if the `ImageContent` would be empty.
pub(crate) fn from_room_message_content(
width: Option<UInt>,
height: Option<UInt>,
@ -253,8 +253,6 @@ impl ThumbnailFileContent {
}
/// Create a `ThumbnailFileContent` with the given thumbnail source and info.
///
/// Returns `None` if no thumbnail was found.
fn from_room_message_content(
source: MediaSource,
mimetype: Option<String>,
@ -295,7 +293,7 @@ impl ThumbnailFileContentInfo {
/// Creates a new `ThumbnailFileContentInfo` with the given optional MIME type and size.
///
/// Returns `None` if both the mimetype and the size are `None`.
/// Returns `None` if the `ThumbnailFileContentInfo` would be empty.
fn from_room_message_content(mimetype: Option<String>, size: Option<UInt>) -> Option<Self> {
if mimetype.is_none() && size.is_none() {
None

View File

@ -164,6 +164,8 @@ impl ImageInfo {
}
/// Create an `ImageInfo` from the given file info, image info and thumbnail.
///
/// Returns `None` if the `ImageInfo` would be empty.
#[cfg(feature = "unstable-msc3552")]
fn from_extensible_content(
file_info: Option<&FileContentInfo>,
@ -233,7 +235,7 @@ impl ThumbnailInfo {
/// Create a `ThumbnailInfo` with the given file info and image info.
///
/// Returns `None` if `file_info` and `image` are `None`.
/// Returns `None` if the `ThumbnailInfo` would be empty.
#[cfg(feature = "unstable-msc3552")]
fn from_extensible_content(
file_info: Option<&ThumbnailFileContentInfo>,

View File

@ -239,6 +239,8 @@ impl VideoInfo {
}
/// Create a `VideoInfo` from the given file info, video info and thumbnail.
///
/// Returns `None` if the `VideoInfo` would be empty.
#[cfg(feature = "unstable-msc3553")]
fn from_extensible_content(
file_info: Option<&FileContentInfo>,