bloop-protocol 1.1.0

Core implementation of the Bloop wire protocol
//! Shared payload records.

use uuid::Uuid;

use crate::data_hash::DataHash;
use bloop_protocol_derive::{Decode, Encode};

/// An awarded achievement together with its optional audio hash.
///
/// A record, not a message: it appears inside [`BloopAccepted`] and
/// [`PreloadMismatch`] payloads and therefore carries no opcode.
///
/// [`BloopAccepted`]: crate::message::BloopAccepted
/// [`PreloadMismatch`]: crate::message::PreloadMismatch
#[derive(Clone, Debug, Decode, Encode, Eq, PartialEq)]
pub struct AchievementRecord {
    /// Unique ID of the achievement.
    pub id: Uuid,

    /// Audio file hash; absent when no audio is available.
    pub audio_hash: Option<DataHash>,
}