collab-common 0.0.7

Code shared by collab's client and server
Documentation
use serde::{Deserialize, Serialize};

use crate::PeerId;

/// TODO: docs
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
pub struct PeerLeft {
    peer_id: PeerId,
}

impl PeerLeft {
    /// Creates a new `PeerLeft` message.
    #[inline]
    pub fn new(peer_id: PeerId) -> Self {
        Self { peer_id }
    }

    /// Returns the [`PeerId`] of the peer that left the session.
    #[inline]
    pub fn peer_id(&self) -> PeerId {
        self.peer_id
    }
}