[][src]Struct rust_cast::channels::media::MediaChannel

pub struct MediaChannel<'a, W> where
    W: Read + Write
{ /* fields omitted */ }

Implementations

impl<'a, W> MediaChannel<'a, W> where
    W: Read + Write
[src]

pub fn new<S>(
    sender: S,
    message_manager: Rc<MessageManager<W>>
) -> MediaChannel<'a, W> where
    S: Into<Cow<'a, str>>, 
[src]

pub fn get_status<S>(
    &self,
    destination: S,
    media_session_id: Option<i32>
) -> Result<Status, Error> where
    S: Into<Cow<'a, str>>, 
[src]

Retrieves status of the cast device media session.

Arguments

  • destination - protocol identifier of specific app media session;
  • media_session_id - Media session ID of the media for which the media status should be returned. If none is provided, then the status for all media session IDs will be provided.

Return value

Returned Result should consist of either Status instance or an Error.

pub fn load<S>(
    &self,
    destination: S,
    session_id: S,
    media: &Media
) -> Result<Status, Error> where
    S: Into<Cow<'a, str>>, 
[src]

Loads provided media to the application.

Arguments

  • destination - protocol of the application to load media with (e.g. web-1);
  • session_id - Current session identifier of the player application;
  • media - Media instance that describes the media we'd like to load.

Return value

Returned Result should consist of either Status instance or an Error.

pub fn pause<S>(
    &self,
    destination: S,
    media_session_id: i32
) -> Result<StatusEntry, Error> where
    S: Into<Cow<'a, str>>, 
[src]

Pauses playback of the current content. Triggers a STATUS event notification to all sender applications.

Arguments

  • destination - protocol of the media application (e.g. web-1);
  • media_session_id - ID of the media session to be paused.

Return value

Returned Result should consist of either Status instance or an Error.

pub fn play<S>(
    &self,
    destination: S,
    media_session_id: i32
) -> Result<StatusEntry, Error> where
    S: Into<Cow<'a, str>>, 
[src]

Begins playback of the content that was loaded with the load call, playback is continued from the current time position.

Arguments

  • destination - protocol of the media application (e.g. web-1);
  • media_session_id - ID of the media session to be played.

Return value

Returned Result should consist of either Status instance or an Error.

pub fn stop<S>(
    &self,
    destination: S,
    media_session_id: i32
) -> Result<StatusEntry, Error> where
    S: Into<Cow<'a, str>>, 
[src]

Stops playback of the current content. Triggers a STATUS event notification to all sender applications. After this command the content will no longer be loaded and the media_session_id is invalidated.

Arguments

  • destination - protocol of the media application (e.g. web-1);
  • media_session_id - ID of the media session to be stopped.

Return value

Returned Result should consist of either Status instance or an Error.

pub fn seek<S>(
    &self,
    destination: S,
    media_session_id: i32,
    current_time: Option<f32>,
    resume_state: Option<ResumeState>
) -> Result<StatusEntry, Error> where
    S: Into<Cow<'a, str>>, 
[src]

Sets the current position in the stream. Triggers a STATUS event notification to all sender applications. If the position provided is outside the range of valid positions for the current content, then the player should pick a valid position as close to the requested position as possible.

Arguments

  • destination - protocol of the media application (e.g. web-1);
  • media_session_id - ID of the media session to seek in;
  • current_time - Time in seconds to seek to.

Return value

Returned Result should consist of either Status instance or an Error.

pub fn can_handle(&self, message: &CastMessage) -> bool[src]

pub fn parse(&self, message: &CastMessage) -> Result<MediaResponse, Error>[src]

Auto Trait Implementations

impl<'a, W> !RefUnwindSafe for MediaChannel<'a, W>[src]

impl<'a, W> !Send for MediaChannel<'a, W>[src]

impl<'a, W> !Sync for MediaChannel<'a, W>[src]

impl<'a, W> Unpin for MediaChannel<'a, W>[src]

impl<'a, W> !UnwindSafe for MediaChannel<'a, W>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.