ReadonlyConnection

Trait ReadonlyConnection 

Source
pub trait ReadonlyConnection {
    // Required methods
    fn on_notification<T: ServiceMethodRequest>(
        &self,
    ) -> impl Stream<Item = Result<T, NetworkError>> + 'static;
    fn one_with_header<T: NetMessage + 'static>(
        &self,
    ) -> impl Future<Output = Result<(NetMessageHeader, T), NetworkError>> + 'static;
    fn one<T: NetMessage + 'static>(
        &self,
    ) -> impl Future<Output = Result<T, NetworkError>> + 'static;
    fn on_with_header<T: NetMessage + 'static>(
        &self,
    ) -> impl Stream<Item = Result<(NetMessageHeader, T), NetworkError>> + 'static;
    fn on<T: NetMessage + 'static>(
        &self,
    ) -> impl Stream<Item = Result<T, NetworkError>> + 'static;
}
Expand description

A trait for connections that only allow listening for messages coming from steam

Required Methods§

Source

fn on_notification<T: ServiceMethodRequest>( &self, ) -> impl Stream<Item = Result<T, NetworkError>> + 'static

Source

fn one_with_header<T: NetMessage + 'static>( &self, ) -> impl Future<Output = Result<(NetMessageHeader, T), NetworkError>> + 'static

Wait for one message of a specific kind, also returning the header

Source

fn one<T: NetMessage + 'static>( &self, ) -> impl Future<Output = Result<T, NetworkError>> + 'static

Wait for one message of a specific kind

Source

fn on_with_header<T: NetMessage + 'static>( &self, ) -> impl Stream<Item = Result<(NetMessageHeader, T), NetworkError>> + 'static

Listen to messages of a specific kind, also returning the header

Source

fn on<T: NetMessage + 'static>( &self, ) -> impl Stream<Item = Result<T, NetworkError>> + 'static

Listen to messages of a specific kind

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ReadonlyConnection for UnAuthenticatedConnection

Listen for messages before starting authentication