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

Implementations§

Launches the specified receiver’s application.

Examples
use std::str::FromStr;
use rust_cast::{CastDevice, channels::receiver::CastDeviceApp};

cast_device.receiver.launch_app(&CastDeviceApp::from_str("youtube").unwrap());
Arguments
  • app - CastDeviceApp instance reference to run.

Broadcasts a message over a cast device’s message bus.

Receiver can observe messages using context.addCustomMessageListener with custom namespace.

context.addCustomMessageListener('urn:x-cast:com.example.castdata', function(customEvent) {
  // do something with message
});

Namespace should start with urn:x-cast:

Arguments
  • namespace - Message namespace that should start with urn:x-cast:.
  • message - Message instance to send.

Stops currently active app using corresponding session_id.

Arguments
  • session_id - identifier of the active application session from Application instance.

Retrieves status of the cast device receiver.

Return value

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

Sets volume for the active cast device.

Arguments
  • volume - anything that can be converted to a valid Volume structure. It’s possible to set volume level, mute/unmute state or both altogether.
Return value

Actual Volume instance returned by receiver.

Errors

Usually method can fail only if network connection with cast device is lost for some reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.