pub struct GatewayClient { /* private fields */ }Expand description
Connected client before its command and event halves are separated.
Implementations§
Source§impl GatewayClient
impl GatewayClient
Sourcepub async fn connect(
endpoint: &Endpoint,
token: impl Into<String>,
client_kind: ClientKind,
) -> Result<Self>
pub async fn connect( endpoint: &Endpoint, token: impl Into<String>, client_kind: ClientKind, ) -> Result<Self>
Authenticates an existing client and leaves the gateway Ready frame for events.
Sourcepub async fn pair(
endpoint: &Endpoint,
code: impl Into<String>,
client_label: impl Into<String>,
client_kind: ClientKind,
) -> Result<(Self, PairedClient)>
pub async fn pair( endpoint: &Endpoint, code: impl Into<String>, client_label: impl Into<String>, client_kind: ClientKind, ) -> Result<(Self, PairedClient)>
Consumes a pending pairing code and returns a connected independent client.
Sourcepub fn into_parts(self) -> (GatewaySender, GatewayEvents)
pub fn into_parts(self) -> (GatewaySender, GatewayEvents)
Separates the clonable command writer from the single event reader.
Auto Trait Implementations§
impl !RefUnwindSafe for GatewayClient
impl !Sync for GatewayClient
impl !UnwindSafe for GatewayClient
impl Freeze for GatewayClient
impl Send for GatewayClient
impl Unpin for GatewayClient
impl UnsafeUnpin for GatewayClient
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