#[non_exhaustive]pub enum Error {
Net(Error),
Json(String),
Flate(Error),
MissingSnapshot,
Desync,
}Expand description
Errors produced while publishing or consuming JSON.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Net(Error)
An error from the underlying track.
Json(String)
A value failed to serialize, deserialize, or apply as a merge patch.
Stored as a string since serde_json::Error is not Clone.
Flate(Error)
A compressed frame could not be decoded (malformed, truncated, or oversized).
MissingSnapshot
A merge patch arrived with no snapshot to apply it to.
Every group opens with a full snapshot, so this means frames reached
snapshot::Decoder out of order, or a group’s first frame was routed as a delta.
Desync
A compressed stream frame was encoded but never written, so the shared DEFLATE window is
ahead of what the consumer holds and nothing later in this group can be decoded.
Unlike snapshot, a stream has no keyframe to resynchronize on, so the encoder refuses to
continue rather than emit frames that cannot be read. Recover by rolling a new group and
calling stream::Encoder::reset.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()