#[non_exhaustive]pub enum StatePublish {
Snapshot(Value),
Delta(JsonPatch),
Unchanged,
}Expand description
What a publish decided to send.
#[non_exhaustive]: another way to publish state can be added without a
breaking release. into_event covers every variant,
so it is the arm to fall back on in a match.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Snapshot(Value)
The whole state — the first publish, or a change too large to patch.
Delta(JsonPatch)
A patch against the previously published snapshot.
Unchanged
The state is byte-identical to the last publish; nothing to send.
Implementations§
Source§impl StatePublish
impl StatePublish
Sourcepub fn into_event(self) -> Option<Event>
pub fn into_event(self) -> Option<Event>
The event to emit, or None for StatePublish::Unchanged.
Trait Implementations§
Source§impl Clone for StatePublish
impl Clone for StatePublish
Source§impl Debug for StatePublish
impl Debug for StatePublish
Source§impl PartialEq for StatePublish
impl PartialEq for StatePublish
impl StructuralPartialEq for StatePublish
Auto Trait Implementations§
impl Freeze for StatePublish
impl RefUnwindSafe for StatePublish
impl Send for StatePublish
impl Sync for StatePublish
impl Unpin for StatePublish
impl UnsafeUnpin for StatePublish
impl UnwindSafe for StatePublish
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