pub struct TypedChannel<S> { /* private fields */ }Implementations§
Source§impl<S> TypedChannel<S>where
S: PondSchema,
impl<S> TypedChannel<S>where
S: PondSchema,
pub fn new(raw: Channel) -> Self
pub fn raw(&self) -> &Channel
pub fn name(&self) -> &str
pub fn state(&self) -> ChannelState
pub fn subscribe_events(&self) -> Receiver<ChannelEvent>
pub async fn presence(&self) -> Result<Vec<S::Presence>, ClientError>
pub async fn join(&self)
pub async fn leave(&self)
pub async fn send<E>(&self, payload: &E::Payload) -> Result<(), ClientError>where
E: PondEvent,
pub async fn request<E>(
&self,
payload: &E::Payload,
timeout: Option<Duration>,
) -> Result<E::Response, ClientError>where
E: PondEvent,
pub fn decode_message<E>(
&self,
message: &ServerMessage,
) -> Result<Option<E::Payload>, ClientError>where
E: PondEvent,
pub fn decode_presence( &self, message: &PresenceMessage, ) -> Result<(S::Presence, Vec<S::Presence>), ClientError>
pub fn decode_event<E>(
&self,
event: ChannelEvent,
) -> Result<Option<E::Payload>, ClientError>where
E: PondEvent,
Trait Implementations§
Source§impl<S: Clone> Clone for TypedChannel<S>
impl<S: Clone> Clone for TypedChannel<S>
Source§fn clone(&self) -> TypedChannel<S>
fn clone(&self) -> TypedChannel<S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<S> Freeze for TypedChannel<S>
impl<S> !RefUnwindSafe for TypedChannel<S>
impl<S> Send for TypedChannel<S>where
S: Send,
impl<S> Sync for TypedChannel<S>where
S: Sync,
impl<S> Unpin for TypedChannel<S>where
S: Unpin,
impl<S> UnsafeUnpin for TypedChannel<S>
impl<S> !UnwindSafe for TypedChannel<S>
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