pub struct SocketChannel { /* private fields */ }Expand description
Socket.IO chat channel. Cheap to clone (Arc-internal); construct
once per process and register as a singleton.
Implementations§
Source§impl SocketChannel
impl SocketChannel
pub fn new(config: SocketChannelConfig) -> Self
Trait Implementations§
Source§impl ChatChannel for SocketChannel
impl ChatChannel for SocketChannel
Source§fn listen(&self, callback: MessageCallback)
fn listen(&self, callback: MessageCallback)
Stash the callback the framework will invoke for every inbound
message. Idempotent: re-listening replaces the previous callback.
Source§fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ChannelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ChannelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the channel: open transports, spawn background tasks.
Source§fn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ChannelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ChannelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the channel: tear down transports, drop the callback.
Source§impl IsSingleton for SocketChannel
DI helper — pair with register_singletons!(&c, SocketChannel).
impl IsSingleton for SocketChannel
DI helper — pair with register_singletons!(&c, SocketChannel).
Requires Arc<SocketChannelConfig> to be registered first.
fn register_in(c: &Container)
Auto Trait Implementations§
impl !RefUnwindSafe for SocketChannel
impl !UnwindSafe for SocketChannel
impl Freeze for SocketChannel
impl Send for SocketChannel
impl Sync for SocketChannel
impl Unpin for SocketChannel
impl UnsafeUnpin for SocketChannel
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