Skip to content

Commit

Permalink
Fix doc links
Browse files Browse the repository at this point in the history
  • Loading branch information
rklaehn committed Jul 3, 2024
1 parent aff0f4c commit e519d0f
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
6 changes: 3 additions & 3 deletions iroh/src/client/authors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use iroh_docs::{Author, AuthorId};
use ref_cast::RefCast;

use crate::rpc_protocol::authors::{
AuthorCreateRequest, DeleteRequest, ExportRequest, GetDefaultRequest, ImportRequest,
ListRequest, SetDefaultRequest,
CreateRequest, DeleteRequest, ExportRequest, GetDefaultRequest, ImportRequest, ListRequest,
SetDefaultRequest,
};

use super::{flatten, RpcClient};
Expand All @@ -27,7 +27,7 @@ impl Client {
///
/// If you need only a single author, use [`Self::default`].
pub async fn create(&self) -> Result<AuthorId> {
let res = self.rpc.rpc(AuthorCreateRequest).await??;
let res = self.rpc.rpc(CreateRequest).await??;
Ok(res.author_id)
}

Expand Down
26 changes: 13 additions & 13 deletions iroh/src/node/rpc/docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ use crate::client::docs::ShareMode;
use crate::node::DocsEngine;
use crate::rpc_protocol::{
authors::{
AuthorCreateRequest, CreateResponse, DeleteRequest, DeleteResponse, ExportRequest,
CreateRequest, CreateResponse, DeleteRequest, DeleteResponse, ExportRequest,
ExportResponse, GetDefaultRequest, GetDefaultResponse, ImportRequest, ImportResponse,
ListRequest as AuthorListRequest, ListResponse as AuthorListResponse, SetDefaultRequest,
SetDefaultResponse,
},
docs::{
CloseRequest, CloseResponse, CreateRequest, CreateResponse as DocCreateResponse,
DelRequest, DelResponse, DocListRequest, DocSubscribeRequest, DocSubscribeResponse,
DropRequest, DropResponse, GetDownloadPolicyRequest, GetDownloadPolicyResponse,
GetExactRequest, GetExactResponse, GetManyRequest, GetManyResponse, GetSyncPeersRequest,
GetSyncPeersResponse, ImportRequest as DocImportRequest,
ImportResponse as DocImportResponse, LeaveRequest, LeaveResponse,
ListResponse as DocListResponse, OpenRequest, OpenResponse, SetDownloadPolicyRequest,
SetDownloadPolicyResponse, SetHashRequest, SetHashResponse, SetRequest, SetResponse,
ShareRequest, ShareResponse, StartSyncRequest, StartSyncResponse, StatusRequest,
StatusResponse,
CloseRequest, CloseResponse, CreateRequest as DocCreateRequest,
CreateResponse as DocCreateResponse, DelRequest, DelResponse, DocListRequest,
DocSubscribeRequest, DocSubscribeResponse, DropRequest, DropResponse,
GetDownloadPolicyRequest, GetDownloadPolicyResponse, GetExactRequest, GetExactResponse,
GetManyRequest, GetManyResponse, GetSyncPeersRequest, GetSyncPeersResponse,
ImportRequest as DocImportRequest, ImportResponse as DocImportResponse, LeaveRequest,
LeaveResponse, ListResponse as DocListResponse, OpenRequest, OpenResponse,
SetDownloadPolicyRequest, SetDownloadPolicyResponse, SetHashRequest, SetHashResponse,
SetRequest, SetResponse, ShareRequest, ShareResponse, StartSyncRequest, StartSyncResponse,
StatusRequest, StatusResponse,
},
};

Expand All @@ -35,7 +35,7 @@ const ITER_CHANNEL_CAP: usize = 64;

#[allow(missing_docs)]
impl DocsEngine {
pub async fn author_create(&self, _req: AuthorCreateRequest) -> RpcResult<CreateResponse> {
pub async fn author_create(&self, _req: CreateRequest) -> RpcResult<CreateResponse> {
// TODO: pass rng
let author = Author::new(&mut rand::rngs::OsRng {});
self.sync.import_author(author.clone()).await?;
Expand Down Expand Up @@ -96,7 +96,7 @@ impl DocsEngine {
Ok(DeleteResponse)
}

pub async fn doc_create(&self, _req: CreateRequest) -> RpcResult<DocCreateResponse> {
pub async fn doc_create(&self, _req: DocCreateRequest) -> RpcResult<DocCreateResponse> {
let namespace = NamespaceSecret::new(&mut rand::rngs::OsRng {});
let id = namespace.id();
self.sync.import_namespace(namespace.into()).await?;
Expand Down
20 changes: 10 additions & 10 deletions iroh/src/rpc_protocol/authors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use super::RpcService;
#[nested_enum_utils::enum_conversions(super::Request)]
pub enum Request {
List(ListRequest),
Create(AuthorCreateRequest),
Create(CreateRequest),
GetDefault(GetDefaultRequest),
SetDefault(SetDefaultRequest),
Import(ImportRequest),
Expand Down Expand Up @@ -43,7 +43,7 @@ impl ServerStreamingMsg<RpcService> for ListRequest {
type Response = RpcResult<ListResponse>;
}

/// Response for [`AuthorListRequest`]
/// Response for [`ListRequest`]
#[derive(Serialize, Deserialize, Debug)]
pub struct ListResponse {
/// The author id
Expand All @@ -52,13 +52,13 @@ pub struct ListResponse {

/// Create a new document author.
#[derive(Serialize, Deserialize, Debug)]
pub struct AuthorCreateRequest;
pub struct CreateRequest;

impl RpcMsg<RpcService> for AuthorCreateRequest {
impl RpcMsg<RpcService> for CreateRequest {
type Response = RpcResult<CreateResponse>;
}

/// Response for [`AuthorCreateRequest`]
/// Response for [`CreateRequest`]
#[derive(Serialize, Deserialize, Debug)]
pub struct CreateResponse {
/// The id of the created author
Expand All @@ -73,7 +73,7 @@ impl RpcMsg<RpcService> for GetDefaultRequest {
type Response = RpcResult<GetDefaultResponse>;
}

/// Response for [`AuthorGetDefaultRequest`]
/// Response for [`GetDefaultRequest`]
#[derive(Serialize, Deserialize, Debug)]
pub struct GetDefaultResponse {
/// The id of the author
Expand All @@ -90,7 +90,7 @@ impl RpcMsg<RpcService> for SetDefaultRequest {
type Response = RpcResult<SetDefaultResponse>;
}

/// Response for [`AuthorGetDefaultRequest`]
/// Response for [`GetDefaultRequest`]
#[derive(Serialize, Deserialize, Debug)]
pub struct SetDefaultResponse;

Expand All @@ -105,7 +105,7 @@ impl RpcMsg<RpcService> for DeleteRequest {
type Response = RpcResult<DeleteResponse>;
}

/// Response for [`AuthorDeleteRequest`]
/// Response for [`DeleteRequest`]
#[derive(Serialize, Deserialize, Debug)]
pub struct DeleteResponse;

Expand All @@ -120,7 +120,7 @@ impl RpcMsg<RpcService> for ExportRequest {
type Response = RpcResult<ExportResponse>;
}

/// Response for [`AuthorExportRequest`]
/// Response for [`ExportRequest`]
#[derive(Serialize, Deserialize, Debug)]
pub struct ExportResponse {
/// The author
Expand All @@ -138,7 +138,7 @@ impl RpcMsg<RpcService> for ImportRequest {
type Response = RpcResult<ImportResponse>;
}

/// Response to [`AuthorImportRequest`]
/// Response to [`ImportRequest`]
#[derive(Serialize, Deserialize, Debug)]
pub struct ImportResponse {
/// The author id of the imported author
Expand Down
6 changes: 3 additions & 3 deletions iroh/src/rpc_protocol/blobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl ServerStreamingMsg<RpcService> for DownloadRequest {
type Response = DownloadResponse;
}

/// Progress response for [`BlobDownloadRequest`]
/// Progress response for [`DownloadRequest`]
#[derive(Debug, Clone, Serialize, Deserialize, derive_more::From, derive_more::Into)]
pub struct DownloadResponse(pub DownloadProgress);

Expand Down Expand Up @@ -148,7 +148,7 @@ impl ServerStreamingMsg<RpcService> for ExportRequest {
type Response = ExportResponse;
}

/// Progress response for [`BlobExportRequest`]
/// Progress response for [`ExportRequest`]
#[derive(Debug, Clone, Serialize, Deserialize, derive_more::From, derive_more::Into)]
pub struct ExportResponse(pub ExportProgress);

Expand Down Expand Up @@ -225,7 +225,7 @@ impl ServerStreamingMsg<RpcService> for ReadAtRequest {
type Response = RpcResult<ReadAtResponse>;
}

/// Response to [`BlobReadAtRequest`]
/// Response to [`ReadAtRequest`]
#[derive(Serialize, Deserialize, Debug)]
pub enum ReadAtResponse {
/// The entry header.
Expand Down
4 changes: 2 additions & 2 deletions iroh/src/rpc_protocol/docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl RpcMsg<RpcService> for CreateRequest {
type Response = RpcResult<CreateResponse>;
}

/// Response to [`DocCreateRequest`]
/// Response to [`CreateRequest`]
#[derive(Serialize, Deserialize, Debug)]
pub struct CreateResponse {
/// The document id
Expand All @@ -147,7 +147,7 @@ impl RpcMsg<RpcService> for ImportRequest {
type Response = RpcResult<ImportResponse>;
}

/// Response to [`DocImportRequest`]
/// Response to [`ImportRequest`]
#[derive(Serialize, Deserialize, Debug)]
pub struct ImportResponse {
/// the document id
Expand Down
2 changes: 1 addition & 1 deletion iroh/src/rpc_protocol/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pub struct CounterStats {
pub description: String,
}

/// Response to [`NodeStatsRequest`]
/// Response to [`StatsRequest`]
#[derive(Serialize, Deserialize, Debug)]
pub struct StatsResponse {
/// Map of statistics
Expand Down

0 comments on commit e519d0f

Please sign in to comment.