commit f74e9c4b9b3d0c57e0172872fe83b351ee9c28a9 Author: Jonas Platte Date: Fri Jun 5 00:01:12 2020 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..96ef6c0b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +Cargo.lock diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..030c71fb --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "ruma" +authors = ["Jonas Platte "] +categories = ["api-bindings", "web-programming"] +keywords = ["matrix", "chat", "messaging", "ruma"] +description = "Types and traits for working with the Matrix protocol." +documentation = "https://docs.rs/ruma-client-api" +homepage = "https://www.ruma.io/" +repository = "https://github.com/ruma/ruma" +readme = "README.md" +license = "MIT" +version = "0.1.0" +edition = "2018" + +[features] +appservice-api = ["ruma-api", "ruma-appservice-api", "ruma-events"] +client-api = ["ruma-api", "ruma-client-api", "ruma-events"] +federation-api = ["ruma-api", "ruma-federation-api", "ruma-signatures"] + +[dependencies] +ruma-common = "0.1.3" +ruma-identifiers = "0.16.2" + +ruma-events = { version = "0.21.3", optional = true } +ruma-signatures = { version = "0.5.0", optional = true } + +ruma-api = { version = "0.16.1", optional = true } +ruma-appservice-api = { version = "0.1.0", optional = true } +ruma-client-api = { version = "0.9.0", optional = true } +ruma-federation-api = { version = "0.0.2", optional = true } diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 00000000..0e474086 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,43 @@ +//! Types and traits for working with the Matrix protocol. +//! +//! This crate re-exports things from all of the other ruma crates so you don't +//! have to manually keep all the versions in sync. +//! +//! Which crates are re-exported can be configured through cargo features. +//! Depending on which parts of Matrix are relevant to you, activate the +//! following features: +//! +//! * `client-api` for the client-server API +//! * `federation-api` for the server-server (federation) API +//! * `appservice-api` for the application service API + +#![deny(missing_docs)] + +pub use ruma_common::*; +#[doc(inline)] +pub use ruma_identifiers as identifiers; + +#[cfg(feature = "ruma-events")] +#[doc(inline)] +pub use ruma_events as events; +#[cfg(feature = "ruma-signatures")] +#[doc(inline)] +pub use ruma_signatures as signatures; + +/// Rust types for various Matrix APIs requests and responses and abstractions for them. +#[cfg(feature = "ruma-api")] +#[doc(inline)] +pub mod api { + // Everything except the `ruma_api!` macro + pub use ruma_api::{error, Endpoint, EndpointError, Metadata}; + + #[cfg(feature = "ruma-appservice-api")] + #[doc(inline)] + pub use ruma_appservice_api as appservice; + #[cfg(feature = "ruma-client-api")] + #[doc(inline)] + pub use ruma_client_api as client; + #[cfg(feature = "ruma-federation-api")] + #[doc(inline)] + pub use ruma_federation_api as federation; +}