pub struct PubSubsStuff {
pub publishers: Arc<[(String, Publisher)]>,
pub subscriptions: Arc<[(String, Subscription)]>,
}Fields§
§publishers: Arc<[(String, Publisher)]>§subscriptions: Arc<[(String, Subscription)]>Implementations§
Source§impl PubSubsStuff
impl PubSubsStuff
pub async fn new( project_id: Option<String>, instance_id: &str, topics: Arc<[&'static str]>, subs: Arc<[&'static str]>, ) -> Result<Self, Box<dyn Error + Send + Sync>>
pub fn get_publisher(&self, name: &str) -> Option<Publisher>
pub fn get_subscription(&self, name: &str) -> Option<Subscription>
pub fn create_message<T: Serialize>( &self, payload: T, ordering_key: Option<String>, ) -> Result<PubsubMessage, Error>
pub async fn publish_fire_and_forget<T: Serialize + Send + 'static>( &self, topic: &str, payload: T, ordering_key: Option<String>, )
Auto Trait Implementations§
impl Freeze for PubSubsStuff
impl !RefUnwindSafe for PubSubsStuff
impl Send for PubSubsStuff
impl Sync for PubSubsStuff
impl Unpin for PubSubsStuff
impl !UnwindSafe for PubSubsStuff
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