pub struct IoDelegate<T, M = ()>{ /* private fields */ }
Expand description
Wire up rpc subscriptions to delegate
struct
Implementations§
Source§impl<T, M> IoDelegate<T, M>
impl<T, M> IoDelegate<T, M>
Sourcepub fn new(delegate: Arc<T>) -> Self
pub fn new(delegate: Arc<T>) -> Self
Creates new PubSubIoDelegate
, wrapping the core IoDelegate
Sourcepub fn add_subscription<Sub, Unsub, I>(
&mut self,
name: &str,
subscribe: (&str, Sub),
unsubscribe: (&str, Unsub),
)
pub fn add_subscription<Sub, Unsub, I>( &mut self, name: &str, subscribe: (&str, Sub), unsubscribe: (&str, Unsub), )
Adds subscription to the delegate.
Sourcepub fn add_method<F, I>(&mut self, name: &str, method: F)
pub fn add_method<F, I>(&mut self, name: &str, method: F)
Adds async method to the delegate.
Sourcepub fn add_method_with_meta<F, I>(&mut self, name: &str, method: F)
pub fn add_method_with_meta<F, I>(&mut self, name: &str, method: F)
Adds async method with metadata to the delegate.
Trait Implementations§
Source§impl<T, M> IntoIterator for IoDelegate<T, M>
impl<T, M> IntoIterator for IoDelegate<T, M>
Source§impl<T, M> IoHandlerExtension<M> for IoDelegate<T, M>
impl<T, M> IoHandlerExtension<M> for IoDelegate<T, M>
Source§fn augment<S: Middleware<M>>(self, handler: &mut MetaIoHandler<M, S>)
fn augment<S: Middleware<M>>(self, handler: &mut MetaIoHandler<M, S>)
Extend given
handler
with additional methods.Auto Trait Implementations§
impl<T, M> Freeze for IoDelegate<T, M>
impl<T, M = ()> !RefUnwindSafe for IoDelegate<T, M>
impl<T, M> Send for IoDelegate<T, M>
impl<T, M> Sync for IoDelegate<T, M>where
M: Sync,
impl<T, M> Unpin for IoDelegate<T, M>where
M: Unpin,
impl<T, M = ()> !UnwindSafe for IoDelegate<T, M>
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