pub struct Publishes {
pub after_create: Option<String>,
pub after_update: Option<String>,
pub after_delete: Option<String>,
}Expand description
The [publish] section of a resource: a topic per write that succeeded.
[publish]
after_create = "order.placed"
after_update = "order.changed"
after_delete = "order.cancelled"This is the shortest path from “a row changed” to “something happens about
it”, with no function in between: the row is the message. What it buys over
an after_create hook that publishes is that the work is not the
requester’s to wait for — the response goes out as soon as the row is
committed, and the handler runs on its own.
Only the three after_* writes are here, and deliberately. A before_*
topic would announce something that has not happened and may still be
rejected, and a list or read publishes nothing worth hearing about.
Unknown keys are rejected, so after_creat fails at load rather than never
firing.
Fields§
§after_create: Option<String>§after_update: Option<String>§after_delete: Option<String>Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Publishes
impl<'de> Deserialize<'de> for Publishes
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
Auto Trait Implementations§
impl Freeze for Publishes
impl RefUnwindSafe for Publishes
impl Send for Publishes
impl Sync for Publishes
impl Unpin for Publishes
impl UnsafeUnpin for Publishes
impl UnwindSafe for Publishes
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