pub struct UnAuthenticatedConnection(/* private fields */);Expand description
A Connection that hasn’t been authentication yet
Implementations§
Source§impl UnAuthenticatedConnection
impl UnAuthenticatedConnection
Sourcepub async fn from_sender_receiver<Sender: Sink<BytesMut, Error = NetworkError> + Send + 'static, Receiver: Stream<Item = Result<BytesMut, NetworkError>> + Send + 'static>(
sender: Sender,
receiver: Receiver,
) -> Result<Self, ConnectionError>
pub async fn from_sender_receiver<Sender: Sink<BytesMut, Error = NetworkError> + Send + 'static, Receiver: Stream<Item = Result<BytesMut, NetworkError>> + Send + 'static>( sender: Sender, receiver: Receiver, ) -> Result<Self, ConnectionError>
Create a connection from a sender, receiver pair.
This allows customizing the transport used by the connection. For example to customize the TLS configuration, use an existing websocket client or use a proxy.
Sourcepub async fn connect(server_list: &ServerList) -> Result<Self, ConnectionError>
pub async fn connect(server_list: &ServerList) -> Result<Self, ConnectionError>
Connect to a server from the server list using the default websocket transport
Sourcepub async fn anonymous(self) -> Result<Connection, ConnectionError>
pub async fn anonymous(self) -> Result<Connection, ConnectionError>
Start an anonymous client session with this connection
Sourcepub async fn anonymous_server(self) -> Result<Connection, ConnectionError>
pub async fn anonymous_server(self) -> Result<Connection, ConnectionError>
Start an anonymous server session with this connection
Sourcepub async fn login<H: AuthConfirmationHandler, G: GuardDataStore>(
self,
account: &str,
password: &str,
guard_data_store: G,
confirmation_handler: H,
) -> Result<Connection, ConnectionError>
pub async fn login<H: AuthConfirmationHandler, G: GuardDataStore>( self, account: &str, password: &str, guard_data_store: G, confirmation_handler: H, ) -> Result<Connection, ConnectionError>
Start a client session with this connection
Sourcepub async fn access(
self,
account: &str,
access_token: &str,
) -> Result<Connection, ConnectionError>
pub async fn access( self, account: &str, access_token: &str, ) -> Result<Connection, ConnectionError>
Start a client session with this connection using access token.
Trait Implementations§
Source§impl ReadonlyConnection for UnAuthenticatedConnection
Listen for messages before starting authentication
impl ReadonlyConnection for UnAuthenticatedConnection
Listen for messages before starting authentication
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
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
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
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
fn on<T: NetMessage + 'static>( &self, ) -> impl Stream<Item = Result<T, NetworkError>> + 'static
Listen to messages of a specific kind
Auto Trait Implementations§
impl Freeze for UnAuthenticatedConnection
impl !RefUnwindSafe for UnAuthenticatedConnection
impl Send for UnAuthenticatedConnection
impl Sync for UnAuthenticatedConnection
impl Unpin for UnAuthenticatedConnection
impl !UnwindSafe for UnAuthenticatedConnection
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