[][src]Struct sqsquatch::PubFut

pub struct PubFut { /* fields omitted */ }

Create futures that will interact with an SQS queue in a publish manner

Methods

impl PubFut[src]

pub fn initialize<T>(region: Region, queue_name: T) -> Result<Self> where
    T: Into<String>, 
[src]

Initialize PubFut

The following sources are checked in order for AWS credentials when calling initialize:

  1. Environment variables: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
  2. credential_process command in the AWS config file, usually located at ~/.aws/config.
  3. AWS credentials file. Usually located at ~/.aws/credentials.
  4. IAM instance profile. Will only work if running on an EC2 instance with an instance profile/role.

If the sources are exhausted without finding credentials, an error is returned.

See the documentation for DefaultCredentialsProvider and ChainProvider for more information.

Example

let publisher = PubFut::initialize(Region::UsEast2, "Orders")?;

pub fn publish_fut<M>(
    &mut self,
    message: M,
    attributes: Option<HashMap<String, String>>
) -> impl Future<Item = SendMessageResult, Error = Error> where
    M: Serialize
[src]

Create a future that will publish a message onto the queue

Important

  • The maximum message size is 256KB. This size includes any attributes you send along as well.

  • A message can include only XML, JSON, and unformatted text. Any characters not included in the following list will be rejected. For more information, see the W3C specification for characters. The following Unicode characters are allowed:

    #x9 | #xA | #xD | #x20 to #xD7FF | #xE000 to #xFFFD | #x10000 to #x10FFFF

Example

// publisher initialized as above..
let result = publisher.publish_fut("test_message", None).compat().await?;
assert_eq!(
    result.message_id,
    Some("5fea7756-0ea4-451a-a703-a558b933e274".to_string())
);

Trait Implementations

impl Clone for PubFut[src]

impl Debug for PubFut[src]

Auto Trait Implementations

impl Send for PubFut

impl Sync for PubFut

impl Unpin for PubFut

impl !UnwindSafe for PubFut

impl !RefUnwindSafe for PubFut

Blanket Implementations

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self