diff --git a/ruma-api-macros/src/lib.rs b/ruma-api-macros/src/lib.rs index dec98679..d7e3b72d 100644 --- a/ruma-api-macros/src/lib.rs +++ b/ruma-api-macros/src/lib.rs @@ -1,7 +1,6 @@ #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] -//! Crate ruma-api-macros provides a procedural macro for easily generating -//! [ruma-api]-compatible endpoints. +//! A procedural macro for easily generating [ruma-api]-compatible endpoints. //! //! This crate should never be used directly; instead, use it through the //! re-exports in ruma-api. Also note that for technical reasons, the diff --git a/ruma-api/src/lib.rs b/ruma-api/src/lib.rs index afcef42d..bd9bf292 100644 --- a/ruma-api/src/lib.rs +++ b/ruma-api/src/lib.rs @@ -1,8 +1,7 @@ #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] -//! Crate `ruma_api` contains core types used to define the requests and responses for each endpoint -//! in the various [Matrix](https://matrix.org) API specifications. -//! These types can be shared by client and server code for all Matrix APIs. +//! Core types used to define the requests and responses for each endpoint in the various +//! [Matrix API specifications][apis]. //! //! When implementing a new Matrix API, each endpoint has a request type which implements //! `Endpoint`, and a response type connected via an associated type. @@ -11,6 +10,8 @@ //! input parameters for requests, and the structure of a successful response. //! Such types can then be used by client code to make requests, and by server code to fulfill //! those requests. +//! +//! [apis]: https://matrix.org/docs/spec/#matrix-apis #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![warn(rust_2018_idioms)] @@ -232,7 +233,7 @@ pub trait EndpointError: StdError + Sized + 'static { ) -> Result; } -/// A request type for a Matrix API endpoint. (trait used for sending requests) +/// A request type for a Matrix API endpoint, used for sending requests. pub trait OutgoingRequest { /// A type capturing the expected error conditions the server can return. type EndpointError: EndpointError; @@ -261,7 +262,7 @@ pub trait OutgoingRequest { ) -> Result>, IntoHttpError>; } -/// A request type for a Matrix API endpoint. (trait used for receiving requests) +/// A request type for a Matrix API endpoint, used for receiving requests. pub trait IncomingRequest: Sized { /// A type capturing the error conditions that can be returned in the response. type EndpointError: EndpointError; @@ -276,10 +277,10 @@ pub trait IncomingRequest: Sized { fn try_from_http_request(req: http::Request>) -> Result; } -/// Marker trait for requests that don't require authentication. (for the client side) +/// Marker trait for requests that don't require authentication, for the client side. pub trait OutgoingNonAuthRequest: OutgoingRequest {} -/// Marker trait for requests that don't require authentication. (for the server side) +/// Marker trait for requests that don't require authentication, for the server side. pub trait IncomingNonAuthRequest: IncomingRequest {} /// Authentication scheme used by the endpoint. diff --git a/ruma-appservice-api/src/lib.rs b/ruma-appservice-api/src/lib.rs index fb262c6e..e88c27ae 100644 --- a/ruma-appservice-api/src/lib.rs +++ b/ruma-appservice-api/src/lib.rs @@ -1,8 +1,9 @@ #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] -//! Crate ruma_appservice_api contains serializable types for the requests and responses for each -//! endpoint in the [Matrix](https://matrix.org/) application service API specification. These -//! types can be shared by application service and server code. +//! (De)serializable types for the [Matrix Application Service API][appservice-api]. +//! These types can be shared by application service and server code. +//! +//! [appservice-api]: https://matrix.org/docs/spec/application_service/r0.1.2.html #![warn(missing_debug_implementations, missing_docs)] diff --git a/ruma-client-api/src/lib.rs b/ruma-client-api/src/lib.rs index 7f8da227..92faef23 100644 --- a/ruma-client-api/src/lib.rs +++ b/ruma-client-api/src/lib.rs @@ -1,8 +1,9 @@ #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] -//! Crate ruma_client_api contains serializable types for the requests and responses for each -//! endpoint in the [Matrix](https://matrix.org/) client API specification. These types can be -//! shared by client and server code. +//! (De)serializable types for the [Matrix Client-Server API][client-api]. +//! These types can be shared by client and server code. +//! +//! [client-api]: https://matrix.org/docs/spec/client_server/r0.6.1.html #![warn(missing_debug_implementations, missing_docs)] diff --git a/ruma-client/src/lib.rs b/ruma-client/src/lib.rs index b185eebc..5be3610d 100644 --- a/ruma-client/src/lib.rs +++ b/ruma-client/src/lib.rs @@ -1,6 +1,6 @@ #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] -//! Crate `ruma_client` is a [Matrix](https://matrix.org/) client library. +//! A [Matrix](https://matrix.org/) client library. //! //! # Usage //! diff --git a/ruma-events-macros/src/lib.rs b/ruma-events-macros/src/lib.rs index 055722eb..e7ffe919 100644 --- a/ruma-events-macros/src/lib.rs +++ b/ruma-events-macros/src/lib.rs @@ -1,7 +1,6 @@ #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] -//! Crate `ruma_events_macros` provides a procedural macro for generating -//! [ruma-events] events. +//! A procedural macro for generating [ruma-events] events. //! //! See the documentation for the individual macros for usage details. //! diff --git a/ruma-events/src/lib.rs b/ruma-events/src/lib.rs index 5e12c05d..54f4c3a2 100644 --- a/ruma-events/src/lib.rs +++ b/ruma-events/src/lib.rs @@ -1,7 +1,7 @@ #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] -//! Crate `ruma_events` contains serializable types for the events in the -//! [Matrix](https://matrix.org) specification that can be shared by client and server code. +//! (De)serializable types for the events in the [Matrix](https://matrix.org) specification. +//! These types are used by other ruma crates. //! //! All data exchanged over Matrix is expressed as an event. //! Different event types represent different actions, such as joining a room or sending a message. diff --git a/ruma-federation-api/src/lib.rs b/ruma-federation-api/src/lib.rs index abec7248..2b97ea7a 100644 --- a/ruma-federation-api/src/lib.rs +++ b/ruma-federation-api/src/lib.rs @@ -1,6 +1,9 @@ #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] -//! (De)serializable types for the Matrix Federation API. +//! (De)serializable types for the [Matrix Server-Server API][federation-api]. +//! These types are used by server code. +//! +//! [federation-api]: https://matrix.org/docs/spec/server_server/r0.1.4.html #![warn(missing_docs)] diff --git a/ruma-identifiers/src/lib.rs b/ruma-identifiers/src/lib.rs index 0d38ef13..7c98b138 100644 --- a/ruma-identifiers/src/lib.rs +++ b/ruma-identifiers/src/lib.rs @@ -1,7 +1,7 @@ #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] -//! Crate **ruma_identifiers** contains types for [Matrix](https://matrix.org/) identifiers -//! for events, rooms, room aliases, room versions, and users. +//! Types for [Matrix](https://matrix.org/) identifiers for devices, events, keys, rooms, servers, +//! users and URIs. #![warn(rust_2018_idioms, missing_debug_implementations, missing_docs)] #![cfg_attr(docsrs, feature(doc_cfg))] diff --git a/ruma-identity-service-api/src/lib.rs b/ruma-identity-service-api/src/lib.rs index 8f157042..3b9decb1 100644 --- a/ruma-identity-service-api/src/lib.rs +++ b/ruma-identity-service-api/src/lib.rs @@ -1,6 +1,9 @@ #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] -//! (De)serializable types for the Matrix Identity Service API. +//! (De)serializable types for the [Matrix Identity Service API][identity-api]. +//! These types can be shared by client and identity service code. +//! +//! [identity-api]: https://matrix.org/docs/spec/identity_service/r0.3.0.html #![warn(missing_docs)] diff --git a/ruma-push-gateway-api/src/lib.rs b/ruma-push-gateway-api/src/lib.rs index 5e7d2cdf..c59fd4d6 100644 --- a/ruma-push-gateway-api/src/lib.rs +++ b/ruma-push-gateway-api/src/lib.rs @@ -1,6 +1,9 @@ #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] -//! (De)serializable types for the Matrix Push Gateway API. +//! (De)serializable types for the [Matrix Push Gateway API][push-api]. +//! These types can be shared by push gateway and server code. +//! +//! [push-api]: https://matrix.org/docs/spec/push_gateway/r0.1.1.html #![warn(missing_docs)] diff --git a/ruma-serde/src/lib.rs b/ruma-serde/src/lib.rs index 92019a23..4c71e7cf 100644 --- a/ruma-serde/src/lib.rs +++ b/ruma-serde/src/lib.rs @@ -1,6 +1,6 @@ #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] -//! De-/serialization helpers for other ruma crates +//! (De)serialization helpers for other ruma crates. pub mod can_be_empty; mod canonical_json; @@ -48,10 +48,12 @@ pub fn is_true(b: &bool) -> bool { *b } -/// A type that can be sent to another party that understands the matrix protocol. If any of the -/// fields of `Self` don't implement serde's `Deserialize`, you can derive this trait to generate a -/// corresponding 'Incoming' type that supports deserialization. This is useful for things like -/// ruma_events' `EventResult` type. For more details, see the [derive macro's documentation][doc]. +/// A type that can be sent to another party that understands the matrix protocol. +/// +/// If any of the fields of `Self` don't implement serde's `Deserialize`, you can derive this trait +/// to generate a corresponding 'Incoming' type that supports deserialization. This is useful for +/// things like ruma_events' `EventResult` type. For more details, see the +/// [derive macro's documentation][doc]. /// /// [doc]: derive.Outgoing.html // TODO: Better explain how this trait relates to serde's traits diff --git a/ruma-signatures/src/lib.rs b/ruma-signatures/src/lib.rs index d839fea6..0061ccf4 100644 --- a/ruma-signatures/src/lib.rs +++ b/ruma-signatures/src/lib.rs @@ -1,7 +1,6 @@ #![doc(html_favicon_url = "https://www.ruma.io/favicon.ico")] #![doc(html_logo_url = "https://www.ruma.io/images/logo.png")] -//! Crate `ruma_signatures` implements digital signatures according to the -//! [Matrix](https://matrix.org/) specification. +//! Digital signatures according to the [Matrix](https://matrix.org/) specification. //! //! Digital signatures are used by Matrix homeservers to verify the authenticity of events in the //! Matrix system, as well as requests between homeservers for federation. Each homeserver has one