#[non_exhaustive]pub struct MediaInfo {
pub media_progress_duration: Option<Duration>,
pub media_progress_percentage: Option<f32>,
/* private fields */
}Available on crate features
recommendation-service or user-event-service only.Expand description
Media-specific user event information.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.media_progress_duration: Option<Duration>The media progress time in seconds, if applicable. For example, if the end user has finished 90 seconds of a playback video, then MediaInfo.media_progress_duration.seconds should be set to 90.
media_progress_percentage: Option<f32>Media progress should be computed using only the media_progress_duration relative to the media total length.
This value must be between [0, 1.0] inclusive.
If this is not a playback or the progress cannot be computed (e.g. ongoing livestream), this field should be unset.
Implementations§
Source§impl MediaInfo
impl MediaInfo
pub fn new() -> Self
Sourcepub fn set_media_progress_duration<T>(self, v: T) -> Self
pub fn set_media_progress_duration<T>(self, v: T) -> Self
Sets the value of media_progress_duration.
§Example
ⓘ
use wkt::Duration;
let x = MediaInfo::new().set_media_progress_duration(Duration::default()/* use setters */);Sourcepub fn set_or_clear_media_progress_duration<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_media_progress_duration<T>(self, v: Option<T>) -> Self
Sets or clears the value of media_progress_duration.
§Example
ⓘ
use wkt::Duration;
let x = MediaInfo::new().set_or_clear_media_progress_duration(Some(Duration::default()/* use setters */));
let x = MediaInfo::new().set_or_clear_media_progress_duration(None::<Duration>);Sourcepub fn set_media_progress_percentage<T>(self, v: T) -> Self
pub fn set_media_progress_percentage<T>(self, v: T) -> Self
Sets the value of media_progress_percentage.
§Example
ⓘ
let x = MediaInfo::new().set_media_progress_percentage(42.0);Sourcepub fn set_or_clear_media_progress_percentage<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_media_progress_percentage<T>(self, v: Option<T>) -> Self
Sets or clears the value of media_progress_percentage.
§Example
ⓘ
let x = MediaInfo::new().set_or_clear_media_progress_percentage(Some(42.0));
let x = MediaInfo::new().set_or_clear_media_progress_percentage(None::<f32>);Trait Implementations§
impl StructuralPartialEq for MediaInfo
Auto Trait Implementations§
impl Freeze for MediaInfo
impl RefUnwindSafe for MediaInfo
impl Send for MediaInfo
impl Sync for MediaInfo
impl Unpin for MediaInfo
impl UnwindSafe for MediaInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more