[][src]Struct streamdeck_rs::socket::StreamDeckSocket

pub struct StreamDeckSocket<G, S, MI, MO> { /* fields omitted */ }

Provides encoding and decoding for messages sent to/from the Stream Deck software.

  • S represents settings persisted within the Stream Deck software.
  • MI represents messages received from the property inspector.
  • MO represents messages sent to the property inspector.

Implementations

impl<G, S, MI, MO> StreamDeckSocket<G, S, MI, MO>[src]

pub async fn connect<A: Into<Address>>(
    address: A,
    event: String,
    uuid: String
) -> Result<Self, ConnectError>
[src]

Begins connecting to the Stream Deck software.

address may be specified either as a port number or as a Url.

Examples

let params = RegistrationParams::from_args(env::args()).unwrap();
let connect = StreamDeckSocket::<GlobalSettings, ActionSettings, PiMessage, PiMessageOut>::connect(params.port, params.event, params.uuid);
tokio::run(connect
    .map_err(|e| println!("connection failed: {:?}", e))
    .and_then(|socket| socket.for_each(|message| println!("received: {:?}", message))
        .map_err(|e| println!("read error: {:?}", e))));

Trait Implementations

impl<G, S, MI, MO> Sink<MessageOut<G, S, MO>> for StreamDeckSocket<G, S, MI, MO> where
    G: Serialize,
    S: Serialize,
    MO: Serialize
[src]

type Error = StreamDeckSocketError

The type of value produced by the sink when an error occurs.

impl<G, S, MI, MO> Stream for StreamDeckSocket<G, S, MI, MO> where
    G: DeserializeOwned,
    S: DeserializeOwned,
    MI: DeserializeOwned
[src]

type Item = Result<Message<G, S, MI>, StreamDeckSocketError>

Values yielded by the stream.

Auto Trait Implementations

impl<G, S, MI, MO> !RefUnwindSafe for StreamDeckSocket<G, S, MI, MO>

impl<G, S, MI, MO> Send for StreamDeckSocket<G, S, MI, MO> where
    G: Send,
    MI: Send,
    MO: Send,
    S: Send

impl<G, S, MI, MO> Sync for StreamDeckSocket<G, S, MI, MO> where
    G: Sync,
    MI: Sync,
    MO: Sync,
    S: Sync

impl<G, S, MI, MO> Unpin for StreamDeckSocket<G, S, MI, MO> where
    G: Unpin,
    MI: Unpin,
    MO: Unpin,
    S: Unpin

impl<G, S, MI, MO> !UnwindSafe for StreamDeckSocket<G, S, MI, MO>

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> Same<T> for T

type Output = T

Should always be Self

impl<T, Item> SinkExt<Item> for T where
    T: Sink<Item> + ?Sized
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized
[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.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,