[−][src]Struct sqsquatch::PubFut
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]
T: Into<String>,
Initialize PubFut
The following sources are checked in order for AWS credentials when calling initialize
:
- Environment variables:
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
credential_process
command in the AWS config file, usually located at~/.aws/config
.- AWS credentials file. Usually located at
~/.aws/credentials
. - 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]
&mut self,
message: M,
attributes: Option<HashMap<String, String>>
) -> impl Future<Item = SendMessageResult, Error = Error> where
M: Serialize,
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
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self