[][src]Struct hedwig::GooglePublisher

pub struct GooglePublisher { /* fields omitted */ }

A publisher that uses Google PubSub. To use this class, add feature google.

Examples

let publisher = GooglePublisher::new(String::from("/home/.google-key.json"), "myproject".into())?;

Methods

impl GooglePublisher[src]

pub fn new<P>(
    google_application_credentials: P,
    google_cloud_project: String
) -> Result<GooglePublisher, HedwigError> where
    P: AsRef<Path>, 
[src]

Create a new instance of GooglePublisher For now, this requires explicitly passing in the path to your credentials file, as well as the name of the project where pubsub infra lives.

Arguments

  • google_application_credentials - Path to the google credentials file.
  • google_cloud_project - The Google Cloud project where your pubsub resources lie - this /may be/ different from the credentials.

Trait Implementations

impl Publisher for GooglePublisher[src]

type MessageIds = Vec<String>

The list of identifiers for successfully published messages.

fn publish(
    &self,
    messages: Vec<(&'static str, ValidatedMessage)>
) -> Result<Self::MessageIds, PublishError>
[src]

Publishes a message on Google Pubsub and returns a pubsub id (usually an integer).

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

impl<T> GetTypeId for T where
    T: Any
[src]