benthic_protocol 0.3.1

Benthic protocol, an intermediate layer between metaverse protocols and client programs.
Documentation
use crate::messages::{ui::ui_messages::UIResponse, utils::chat_types::ChatType};
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone)]
/// the chat event sent from the UI
pub struct ChatFromUI {
    /// the message of the chat
    pub message: String,
    /// the type of the chat
    pub message_type: ChatType,
    /// the channel the message was sent on
    pub channel: i32,
}

impl UIResponse {
    /// Implement UiEvent for ChatFromViewer to allow it to be sent from the UI to the core
    pub fn new_chat_from_viewer(data: ChatFromUI) -> Self {
        UIResponse::ChatFromViewer(data)
    }
}