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.
|
/// 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(
|
pub(crate) fn from_room_message_content(
|
||||||
filename: Option<String>,
|
filename: Option<String>,
|
||||||
mimetype: Option<String>,
|
mimetype: Option<String>,
|
||||||
|
@ -163,7 +163,7 @@ impl ImageContent {
|
|||||||
|
|
||||||
/// Creates a new `ImageContent` with the given optional width and height.
|
/// 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(
|
pub(crate) fn from_room_message_content(
|
||||||
width: Option<UInt>,
|
width: Option<UInt>,
|
||||||
height: Option<UInt>,
|
height: Option<UInt>,
|
||||||
@ -253,8 +253,6 @@ impl ThumbnailFileContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Create a `ThumbnailFileContent` with the given thumbnail source and info.
|
/// Create a `ThumbnailFileContent` with the given thumbnail source and info.
|
||||||
///
|
|
||||||
/// Returns `None` if no thumbnail was found.
|
|
||||||
fn from_room_message_content(
|
fn from_room_message_content(
|
||||||
source: MediaSource,
|
source: MediaSource,
|
||||||
mimetype: Option<String>,
|
mimetype: Option<String>,
|
||||||
@ -295,7 +293,7 @@ impl ThumbnailFileContentInfo {
|
|||||||
|
|
||||||
/// Creates a new `ThumbnailFileContentInfo` with the given optional MIME type and size.
|
/// 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> {
|
fn from_room_message_content(mimetype: Option<String>, size: Option<UInt>) -> Option<Self> {
|
||||||
if mimetype.is_none() && size.is_none() {
|
if mimetype.is_none() && size.is_none() {
|
||||||
None
|
None
|
||||||
|
@ -164,6 +164,8 @@ impl ImageInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Create an `ImageInfo` from the given file info, image info and thumbnail.
|
/// Create an `ImageInfo` from the given file info, image info and thumbnail.
|
||||||
|
///
|
||||||
|
/// Returns `None` if the `ImageInfo` would be empty.
|
||||||
#[cfg(feature = "unstable-msc3552")]
|
#[cfg(feature = "unstable-msc3552")]
|
||||||
fn from_extensible_content(
|
fn from_extensible_content(
|
||||||
file_info: Option<&FileContentInfo>,
|
file_info: Option<&FileContentInfo>,
|
||||||
@ -233,7 +235,7 @@ impl ThumbnailInfo {
|
|||||||
|
|
||||||
/// Create a `ThumbnailInfo` with the given file info and image info.
|
/// 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")]
|
#[cfg(feature = "unstable-msc3552")]
|
||||||
fn from_extensible_content(
|
fn from_extensible_content(
|
||||||
file_info: Option<&ThumbnailFileContentInfo>,
|
file_info: Option<&ThumbnailFileContentInfo>,
|
||||||
|
@ -239,6 +239,8 @@ impl VideoInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Create a `VideoInfo` from the given file info, video info and thumbnail.
|
/// Create a `VideoInfo` from the given file info, video info and thumbnail.
|
||||||
|
///
|
||||||
|
/// Returns `None` if the `VideoInfo` would be empty.
|
||||||
#[cfg(feature = "unstable-msc3553")]
|
#[cfg(feature = "unstable-msc3553")]
|
||||||
fn from_extensible_content(
|
fn from_extensible_content(
|
||||||
file_info: Option<&FileContentInfo>,
|
file_info: Option<&FileContentInfo>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user