pub struct Envelope { /* private fields */ }Expand description
Raw Gingr webhook envelope before signature verification and required-field promotion.
Implementations§
Source§impl Envelope
impl Envelope
Sourcepub fn from_json(raw: impl AsRef<str>) -> ParseResult<Self>
pub fn from_json(raw: impl AsRef<str>) -> ParseResult<Self>
Parses a raw Gingr webhook request body into an unverified envelope.
Sourcepub fn event_type_input(&self) -> Option<&str>
pub fn event_type_input(&self) -> Option<&str>
Returns the raw event type field supplied by Gingr, if present.
Sourcepub fn entity_type_input(&self) -> Option<&str>
pub fn entity_type_input(&self) -> Option<&str>
Returns the raw entity type field supplied by Gingr, if present.
Sourcepub fn signature_input(&self) -> Option<&str>
pub fn signature_input(&self) -> Option<&str>
Returns the signature value supplied with the webhook payload, if present.
Sourcepub fn verify(self, key: &SignatureKey) -> VerificationResult<Verified>
pub fn verify(self, key: &SignatureKey) -> VerificationResult<Verified>
Validates the webhook signature and promotes required provider fields into typed values.
Trait Implementations§
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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