aboutsummaryrefslogtreecommitdiff
path: root/games/rstnode/rst-core/src/wire/proto/mod.rs
blob: 07598bc855405489d2252f2ea27081ccdd54d1d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//! This module implements the client-server game protocol

use super::{Request, Response};

pub enum NetErr {
    Refused,
    Dropped,
    Timeout,
    BadData,
}

/// Use this function to send a request to a partical remote
///
/// The function makes sure that you get a valid response back, but
/// does not yet ensure that this response is correct for the request
/// in question.
pub fn request_to(r: Request, remote: String) -> Result<Response, NetErr> {
    todo!()
}

/// Use this function to send a response to a client
pub fn response_to(r: Response, client: String) -> Result<(), NetErr> {
    todo!()
}