#[non_exhaustive]pub struct HookSnapshot {
pub hook_id: String,
pub token: String,
pub status: HookStatus,
pub metadata: JsonValue,
pub payload: Option<JsonValue>,
}Expand description
Materialized state of one external callback hook.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.hook_id: StringReplay-stable identity of the hook.
token: StringSecret bearer token used to resolve the hook.
status: HookStatusCurrent lifecycle state.
metadata: JsonValueApplication metadata pinned when the hook was created.
payload: Option<JsonValue>JSON payload received from the external caller.
Implementations§
Source§impl HookSnapshot
impl HookSnapshot
Sourcepub fn new(
hook_id: impl Into<String>,
token: impl Into<String>,
status: HookStatus,
metadata: JsonValue,
payload: Option<JsonValue>,
) -> Self
pub fn new( hook_id: impl Into<String>, token: impl Into<String>, status: HookStatus, metadata: JsonValue, payload: Option<JsonValue>, ) -> Self
Create a materialized hook value for a custom event-store projection.
Sourcepub fn metadata_as<T>(&self) -> Result<T>where
T: DeserializeOwned,
pub fn metadata_as<T>(&self) -> Result<T>where
T: DeserializeOwned,
Decode the persisted hook metadata into a host-defined serde type.
Sourcepub fn payload_as<T>(&self) -> Result<Option<T>>where
T: DeserializeOwned,
pub fn payload_as<T>(&self) -> Result<Option<T>>where
T: DeserializeOwned,
Decode the received hook payload into a host-defined serde type.
Trait Implementations§
Source§impl Clone for HookSnapshot
impl Clone for HookSnapshot
Source§fn clone(&self) -> HookSnapshot
fn clone(&self) -> HookSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HookSnapshot
impl Debug for HookSnapshot
Source§impl<'de> Deserialize<'de> for HookSnapshot
impl<'de> Deserialize<'de> for HookSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for HookSnapshot
impl PartialEq for HookSnapshot
Source§impl Serialize for HookSnapshot
impl Serialize for HookSnapshot
impl StructuralPartialEq for HookSnapshot
Auto Trait Implementations§
impl Freeze for HookSnapshot
impl RefUnwindSafe for HookSnapshot
impl Send for HookSnapshot
impl Sync for HookSnapshot
impl Unpin for HookSnapshot
impl UnsafeUnpin for HookSnapshot
impl UnwindSafe for HookSnapshot
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