mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-12-22 11:39:30 +00:00
doc fixes
This commit is contained in:
parent
0ce957389b
commit
fa1e5cafaf
10 changed files with 30 additions and 16 deletions
|
@ -31,8 +31,9 @@ However, each type will document:
|
|||
|
||||
# Naming
|
||||
The naming for types within `{json,bin,other}` follow the following scheme:
|
||||
- Convert the endpoint or method name into `UpperCamelCase`
|
||||
- Remove any suffix extension
|
||||
1. Convert the endpoint or method name into `UpperCamelCase`
|
||||
1. Remove any suffix extension
|
||||
1. Add `Request/Response` suffix
|
||||
|
||||
For example:
|
||||
|
||||
|
@ -57,8 +58,11 @@ however some fields contain binary values inside JSON strings, for example:
|
|||
|
||||
`binary` here is (de)serialized as a normal [`String`]. In order to be clear on which fields contain binary data, the struct fields that have them will use [`crate::misc::BinaryString`] instead of [`String`].
|
||||
|
||||
- TODO: list the specific types.
|
||||
- TODO: we need to figure out a type that (de)serializes correctly, `String` errors with `serde_json`
|
||||
These mixed types are:
|
||||
- [`crate::json::GetTransactionPoolBacklogResponse`]
|
||||
- [`crate::json::GetOutputDistributionResponse`]
|
||||
|
||||
TODO: we need to figure out a type that (de)serializes correctly, `String` errors with `serde_json`
|
||||
|
||||
# Feature flags
|
||||
List of feature flags for `cuprate-rpc-types`.
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
//! Binary types from [binary](https://www.getmonero.org/resources/developer-guides/daemon-rpc.html#get_blocksbin) endpoints.
|
||||
//! Binary types from [`.bin` endpoints](https://www.getmonero.org/resources/developer-guides/daemon-rpc.html#get_blocksbin).
|
||||
//!
|
||||
//! Most (if not all) of these types are defined here:
|
||||
//! - <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server_commands_defs.h>
|
||||
//! All types are originally defined in [`rpc/core_rpc_server_commands_defs.h`](https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server_commands_defs.h).
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- Import
|
||||
use crate::{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
//! JSON types from the [`/json_rpc`](https://www.getmonero.org/resources/developer-guides/daemon-rpc.html#json-rpc-methods) endpoint.
|
||||
//!
|
||||
//! Most (if not all) of these types are defined here:
|
||||
//! - <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server_commands_defs.h>
|
||||
//! All types are originally defined in [`rpc/core_rpc_server_commands_defs.h`](https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server_commands_defs.h).
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- Import
|
||||
use crate::{
|
||||
|
|
|
@ -102,7 +102,10 @@
|
|||
)
|
||||
)]
|
||||
// TODO: remove me after finishing impl
|
||||
#![allow(dead_code)]
|
||||
#![allow(
|
||||
dead_code,
|
||||
rustdoc::broken_intra_doc_links // TODO: remove after `{bin,json,other}.rs` gets merged
|
||||
)]
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- Mod
|
||||
mod constants;
|
||||
|
|
|
@ -11,6 +11,11 @@ use cuprate_epee_encoding::{
|
|||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- KeyImageSpentStatus
|
||||
#[doc = crate::macros::monero_definition_link!(
|
||||
cc73fe71162d564ffda8e549b79a350bca53c454,
|
||||
"rpc/core_rpc_server_commands_defs.h",
|
||||
456..=460
|
||||
)]
|
||||
/// Used in [`crate::other::IsKeyImageSpentResponse`].
|
||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
|
|
|
@ -31,7 +31,8 @@ use crate::{
|
|||
///
|
||||
/// This macro:
|
||||
/// 1. Defines a `pub struct` with all `pub` fields
|
||||
/// 2. Implements `epee` on the struct
|
||||
/// 2. Implements `serde` on the struct
|
||||
/// 3. Implements `epee` on the struct
|
||||
///
|
||||
/// When using, consider documenting:
|
||||
/// - The original Monero definition site with [`monero_definition_link`]
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
//! Miscellaneous types.
|
||||
//!
|
||||
//! These are `struct`s that appear in request/response types.
|
||||
//! These are data types that appear in request/response types.
|
||||
//!
|
||||
//! For example, [`crate::json::GetConnectionsResponse`] contains
|
||||
//! the [`crate::misc::ConnectionInfo`] struct defined here.
|
||||
|
||||
|
|
|
@ -11,6 +11,11 @@ use cuprate_epee_encoding::{
|
|||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- PoolInfoExtent
|
||||
#[doc = crate::macros::monero_definition_link!(
|
||||
cc73fe71162d564ffda8e549b79a350bca53c454,
|
||||
"rpc/core_rpc_server_commands_defs.h",
|
||||
223..=228
|
||||
)]
|
||||
/// Used in [`crate::bin::GetBlocksResponse`].
|
||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
|
|
|
@ -26,8 +26,6 @@ use crate::constants::{
|
|||
///
|
||||
/// This type represents `monerod`'s frequently appearing string field, `status`.
|
||||
///
|
||||
/// This field appears within RPC [JSON response](crate::json) types.
|
||||
///
|
||||
/// Reference: <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server_commands_defs.h#L78-L81>.
|
||||
///
|
||||
/// ## Serialization and string formatting
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
//! JSON types from the [`other`](https://www.getmonero.org/resources/developer-guides/daemon-rpc.html#other-daemon-rpc-calls) endpoints.
|
||||
//!
|
||||
//! Most (if not all) of these types are defined here:
|
||||
//! - <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server_commands_defs.h>
|
||||
//! All types are originally defined in [`rpc/core_rpc_server_commands_defs.h`](https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server_commands_defs.h).
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- Import
|
||||
use crate::{
|
||||
|
|
Loading…
Reference in a new issue