Document and expose public members for Rojo API

This commit is contained in:
Lucien Greathouse
2019-09-03 14:20:12 -07:00
parent cf5f20bbb5
commit d5c816f24d
4 changed files with 19 additions and 6 deletions

View File

@@ -1,5 +1,4 @@
//! Defines all the structs needed to interact with the Rojo API from an
//! automation test perspective.
//! Defines all the structs needed to interact with the Rojo Serve API.
use std::collections::HashSet;
@@ -7,9 +6,13 @@ use serde::{Deserialize, Serialize};
use crate::session_id::SessionId;
pub const SERVER_VERSION: &str = env!("CARGO_PKG_VERSION");
/// Server version to report over the API, not exposed outside this crate.
pub(crate) const SERVER_VERSION: &str = env!("CARGO_PKG_VERSION");
/// Current protocol version, which is required to match.
pub const PROTOCOL_VERSION: u64 = 3;
/// Response body from /api/rojo
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ServerInfoResponse<'a> {
@@ -20,6 +23,7 @@ pub struct ServerInfoResponse<'a> {
// pub root_instance_id: RbxId,
}
/// Response body from /api/read/{id}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ReadResponse {
@@ -28,6 +32,7 @@ pub struct ReadResponse {
// pub instances: HashMap<RbxId, InstanceWithMetadata<'a>>,
}
/// Response body from /api/subscribe/{cursor}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SubscribeResponse {