mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-24 14:45:56 +00:00
Document and expose public members for Rojo API
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
|
// Recursion limit bump is to support Ritz, a JSX-like proc macro used for
|
||||||
|
// Rojo's web UI currently.
|
||||||
#![recursion_limit = "128"]
|
#![recursion_limit = "128"]
|
||||||
|
|
||||||
// Macros
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
mod impl_from;
|
mod impl_from;
|
||||||
|
|
||||||
pub mod commands;
|
pub mod commands;
|
||||||
|
|
||||||
// This module is only public for the purpose of testing right now, and won't be
|
// This module is only public for testing right now, and won't be
|
||||||
// part of the first version of the Rojo API.
|
// part of the first version of the Rojo API.
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub mod project;
|
pub mod project;
|
||||||
@@ -21,3 +22,6 @@ mod session_id;
|
|||||||
mod snapshot;
|
mod snapshot;
|
||||||
mod snapshot_middleware;
|
mod snapshot_middleware;
|
||||||
mod web;
|
mod web;
|
||||||
|
|
||||||
|
pub use crate::session_id::SessionId;
|
||||||
|
pub use crate::web::interface as web_interface;
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
|
/// A randomly generated ID generated by Rojo during a serve session.
|
||||||
|
///
|
||||||
|
/// If the session ID of the server changes between requests, that indicates
|
||||||
|
/// that a new server has started up and the session should be terminated.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||||
pub struct SessionId(Uuid);
|
pub struct SessionId(Uuid);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//! Defines all the structs needed to interact with the Rojo API from an
|
//! Defines all the structs needed to interact with the Rojo Serve API.
|
||||||
//! automation test perspective.
|
|
||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
@@ -7,9 +6,13 @@ use serde::{Deserialize, Serialize};
|
|||||||
|
|
||||||
use crate::session_id::SessionId;
|
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;
|
pub const PROTOCOL_VERSION: u64 = 3;
|
||||||
|
|
||||||
|
/// Response body from /api/rojo
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct ServerInfoResponse<'a> {
|
pub struct ServerInfoResponse<'a> {
|
||||||
@@ -20,6 +23,7 @@ pub struct ServerInfoResponse<'a> {
|
|||||||
// pub root_instance_id: RbxId,
|
// pub root_instance_id: RbxId,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Response body from /api/read/{id}
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct ReadResponse {
|
pub struct ReadResponse {
|
||||||
@@ -28,6 +32,7 @@ pub struct ReadResponse {
|
|||||||
// pub instances: HashMap<RbxId, InstanceWithMetadata<'a>>,
|
// pub instances: HashMap<RbxId, InstanceWithMetadata<'a>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Response body from /api/subscribe/{cursor}
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct SubscribeResponse {
|
pub struct SubscribeResponse {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
mod api;
|
mod api;
|
||||||
mod interface;
|
pub mod interface;
|
||||||
mod ui;
|
mod ui;
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user