pub struct EventbusBridge { /* private fields */ }Available on crate feature
bridge only.Expand description
A bridge to connect two seperated Eventbus
Implementations§
Source§impl EventbusBridge
impl EventbusBridge
Sourcepub async fn connect<E: AsRef<str>>(&self, endpoint: E) -> Result<(), Error>
pub async fn connect<E: AsRef<str>>(&self, endpoint: E) -> Result<(), Error>
connect to another Eventbus
Sourcepub async fn listen(self, addr: SocketAddr) -> Result<(), Error>
pub async fn listen(self, addr: SocketAddr) -> Result<(), Error>
bind to an address and listen for connections
Sourcepub async fn create_topic<T: 'static, K: Into<TopicKey>>(
&self,
topic_key: K,
) -> BridgedTopic<T>
pub async fn create_topic<T: 'static, K: Into<TopicKey>>( &self, topic_key: K, ) -> BridgedTopic<T>
create a Topic using a topic key
Sourcepub async fn register<T: DeserializeOwned + Send + Sync + 'static, K: Into<TopicKey>, L: Listener<T>>(
&self,
topic_key: K,
listener: L,
) -> BridgedEventListener<T>
pub async fn register<T: DeserializeOwned + Send + Sync + 'static, K: Into<TopicKey>, L: Listener<T>>( &self, topic_key: K, listener: L, ) -> BridgedEventListener<T>
register a listener to bridged eventbus
Sourcepub async fn unregister<T: 'static>(
&self,
event_listener: BridgedEventListener<T>,
)
pub async fn unregister<T: 'static>( &self, event_listener: BridgedEventListener<T>, )
unregister a bridged event listener
Trait Implementations§
Source§impl Clone for EventbusBridge
impl Clone for EventbusBridge
Source§fn clone(&self) -> EventbusBridge
fn clone(&self) -> EventbusBridge
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 Freeze for EventbusBridge
impl !RefUnwindSafe for EventbusBridge
impl Send for EventbusBridge
impl Sync for EventbusBridge
impl Unpin for EventbusBridge
impl UnsafeUnpin for EventbusBridge
impl !UnwindSafe for EventbusBridge
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request