Something went wrong. Try again.
[AWIP] Local-first peer-to-peer connectivity and sharing across Android, Linux and Windows, made with Tauri
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152#![allow(dead_code)]
use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Eq, Serialize)]#[serde(rename_all = "snake_case")]pub enum ProtocolErrorCode { InvalidEnvelope, UnsupportedVersion, UnknownMessageType, InvalidPayload, LimitExceeded, SequenceViolation, Unauthorized, Timeout, PeerUnavailable, Internal,}
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Eq, Serialize)]#[serde(rename_all = "snake_case")]pub enum ProtocolErrorScope { Message, Channel, Session, Application,}
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]pub struct ProtocolError { pub code: ProtocolErrorCode, pub retryable: bool, pub scope: ProtocolErrorScope, pub correlation_id: String,}
impl ProtocolError { pub fn new( code: ProtocolErrorCode, retryable: bool, scope: ProtocolErrorScope, correlation_id: impl Into<String>, ) -> Self { Self { code, retryable, scope, correlation_id: correlation_id.into(), } }}