Struct Message

Source
pub struct Message<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Message<'a>

Source

pub async fn list( &self, app_id: String, options: Option<MessageListOptions>, ) -> Result<ListResponseMessageOut>

List all of the application’s messages.

The before and after parameters let you filter all items created before or after a certain date. These can be used alongside an iterator to paginate over results within a certain window.

Note that by default this endpoint is limited to retrieving 90 days’ worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the before or after parameter as appropriate.

Source

pub async fn create( &self, app_id: String, message_in: MessageIn, options: Option<PostOptions>, ) -> Result<MessageOut>

Creates a new message and dispatches it to all of the application’s endpoints.

The eventId is an optional custom unique ID. It’s verified to be unique only up to a day, after that no verification will be made. If a message with the same eventId already exists for the application, a 409 conflict error will be returned.

The eventType indicates the type and schema of the event. All messages of a certain eventType are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have channels, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don’t imply a specific message content or schema.

The payload property is the webhook’s body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it’s generally a good idea to keep webhook payloads small, probably no larger than 40kb.

Source

pub async fn get(&self, app_id: String, msg_id: String) -> Result<MessageOut>

Get a message by its ID or eventID.

Source

pub async fn expunge_content( &self, app_id: String, msg_id: String, ) -> Result<()>

Delete the given message’s payload. Useful in cases when a message was accidentally sent with sensitive content.

The message can’t be replayed or resent once its payload has been deleted or expired.

Auto Trait Implementations§

§

impl<'a> Freeze for Message<'a>

§

impl<'a> !RefUnwindSafe for Message<'a>

§

impl<'a> Send for Message<'a>

§

impl<'a> Sync for Message<'a>

§

impl<'a> Unpin for Message<'a>

§

impl<'a> !UnwindSafe for Message<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,