events: Improve extensible events conversion helpers docs
This commit is contained in:
parent
be2310294a
commit
a4e6081b41
@ -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>,
|
||||
|
@ -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
|
||||
|
@ -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>,
|
||||
|
@ -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>,
|
||||
|
Loading…
x
Reference in New Issue
Block a user