pub struct PendingSend<'a> { /* private fields */ }Expand description
A send prepared by a helper (Honk::loud, Honk::uhoh, …). Chain more fields, then
.await it (or call send).
Implementations§
Source§impl<'a> PendingSend<'a>
impl<'a> PendingSend<'a>
Sourcepub fn idempotency_key(self, key: impl Into<String>) -> Self
pub fn idempotency_key(self, key: impl Into<String>) -> Self
Uses this stable key instead of a new UUIDv7 (1–128 printable ASCII characters).
Sourcepub fn priority(self, value: Priority) -> Self
pub fn priority(self, value: Priority) -> Self
Sets the priority (urgent needs a key with allow_urgent).
Sourcepub fn environment(self, value: impl Into<String>) -> Self
pub fn environment(self, value: impl Into<String>) -> Self
Sets the environment (at most 32 characters).
Sourcepub fn channel(self, value: impl Into<String>) -> Self
pub fn channel(self, value: impl Into<String>) -> Self
Sets the channel (at most 64 characters).
Sourcepub fn group_key(self, value: impl Into<String>) -> Self
pub fn group_key(self, value: impl Into<String>) -> Self
Sets the group key, e.g. requests/4812.
Sourcepub fn event_type(self, value: EventType) -> Self
pub fn event_type(self, value: EventType) -> Self
Sets the event type.
Sourcepub fn occurred_at(self, value: SystemTime) -> Self
pub fn occurred_at(self, value: SystemTime) -> Self
Sets when the event happened at the source.
Sourcepub fn image_url(self, value: impl Into<String>) -> Self
pub fn image_url(self, value: impl Into<String>) -> Self
Sets an https image the server fetches after ingestion.
Sourcepub fn ttl_seconds(self, value: u32) -> Self
pub fn ttl_seconds(self, value: u32) -> Self
Sets the push lifetime in seconds (60–86400).
Sourcepub fn source_sequence(self, value: u64) -> Self
pub fn source_sequence(self, value: u64) -> Self
Sets the monotonic source sequence (needs a group key).
Sourcepub fn action(self, title: impl Into<String>, url: impl Into<String>) -> Self
pub fn action(self, title: impl Into<String>, url: impl Into<String>) -> Self
Adds a button (at most 3, in display order), e.g. .action("Call", "tel:+15550134").
Sourcepub fn metadata(
self,
key: impl Into<String>,
value: impl Into<MetadataValue>,
) -> Self
pub fn metadata( self, key: impl Into<String>, value: impl Into<MetadataValue>, ) -> Self
Adds one metadata entry (a string, number or boolean).
Sourcepub async fn send(self) -> Result<Accepted>
pub async fn send(self) -> Result<Accepted>
Sends it, like Honk::send.
Trait Implementations§
Source§impl Debug for PendingSend<'_>
impl Debug for PendingSend<'_>
Source§impl<'a> IntoFuture for PendingSend<'a>
impl<'a> IntoFuture for PendingSend<'a>
Source§type IntoFuture = Pin<Box<dyn Future<Output = Result<Accepted, Error>> + Send + 'a>>
type IntoFuture = Pin<Box<dyn Future<Output = Result<Accepted, Error>> + Send + 'a>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PendingSend<'a>
impl<'a> !UnwindSafe for PendingSend<'a>
impl<'a> Freeze for PendingSend<'a>
impl<'a> Send for PendingSend<'a>
impl<'a> Sync for PendingSend<'a>
impl<'a> Unpin for PendingSend<'a>
impl<'a> UnsafeUnpin for PendingSend<'a>
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