pub struct Message { /* private fields */ }
Expand description
A representation of a complete message that can be sent. It requires your project_id and an authentication JWT token (see https://cloud.google.com/docs/authentication/).
For automatic handling of the JWT authentication, see the oauth
feature and the Message::with_oauth
function.
Implementations§
Source§impl Message
impl Message
Sourcepub async fn with_oauth(
project_id: impl Into<String>,
body: MessageBody,
) -> Result<Self, Error>
Available on crate feature oauth
only.
pub async fn with_oauth( project_id: impl Into<String>, body: MessageBody, ) -> Result<Self, Error>
oauth
only.Create a new Message and automatically handle (oauth) authentication. Requires the oauth
feature.
To use this, make sure to set the GOOGLE_APPLICATION_CREDENTIALS
environment variable with the path to the credentials.json
file.
Check the GCP documentation to obtain such file: https://cloud.google.com/docs/authentication/provide-credentials-adc.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more