pub enum Response<V> {
State {
version: u64,
view: V,
},
Ack,
Error(String),
}Expand description
A message back to the client. V is a game’s View type.
Variants§
State
A seat’s current view, plus the state version it was taken at.
version is a counter the host bumps once per applied action. Nothing
consumes it yet; it is banked now so a later QuerySince(version) can
answer “nothing changed” or send a delta without a wire-format break,
and so a polling client can tell a stale snapshot from a fresh one.
Ack
An action was accepted and applied. Deliberately carries no state: a
write is acknowledged cheaply, and a client fetches the result with an
explicit Request::Query only when it actually needs to render.
Error(String)
The request was rejected. The message is for humans and logs, not for programmatic matching.
Trait Implementations§
Source§impl<'de, V> Deserialize<'de> for Response<V>where
V: Deserialize<'de>,
impl<'de, V> Deserialize<'de> for Response<V>where
V: Deserialize<'de>,
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<V: PartialEq> PartialEq for Response<V>
impl<V: PartialEq> PartialEq for Response<V>
impl<V: Eq> Eq for Response<V>
impl<V> StructuralPartialEq for Response<V>
Auto Trait Implementations§
impl<V> Freeze for Response<V>where
V: Freeze,
impl<V> RefUnwindSafe for Response<V>where
V: RefUnwindSafe,
impl<V> Send for Response<V>where
V: Send,
impl<V> Sync for Response<V>where
V: Sync,
impl<V> Unpin for Response<V>where
V: Unpin,
impl<V> UnsafeUnpin for Response<V>where
V: UnsafeUnpin,
impl<V> UnwindSafe for Response<V>where
V: UnwindSafe,
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