Struct comet_eventbus::bridge::EventbusBridge
source · pub struct EventbusBridge { /* private fields */ }
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 copy of the value. Read more
1.0.0 · 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 !RefUnwindSafe for EventbusBridge
impl Send for EventbusBridge
impl Sync for EventbusBridge
impl Unpin 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> 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