Fix broken tests

develop
Katharina Fey 3 years ago
parent 89eecad799
commit e5ff519851
Signed by: kookie
GPG Key ID: F972AEEA2887D547
  1. 32
      Cargo.lock
  2. 6
      clients/hubd/Cargo.toml
  3. 6
      clients/hubd/src/state.rs
  4. 2
      irdest-core/Cargo.toml
  5. 14
      irdest-core/src/api/contacts.rs
  6. 10
      irdest-core/src/api/messages.rs
  7. 4
      irdest-core/src/api/mod.rs
  8. 6
      irdest-core/src/api/services.rs
  9. 12
      irdest-core/src/api/users.rs
  10. 28
      irdest-core/src/discover.rs
  11. 10
      irdest-core/src/ffi/java/users.rs
  12. 10
      irdest-core/src/ird.rs
  13. 12
      irdest-core/src/lib.rs
  14. 2
      irdest-core/src/messages/generator.rs
  15. 10
      irdest-core/src/rpc.rs
  16. 2
      irdest-core/src/users/store.rs
  17. 6
      irdest-core/tests/harness/mod.rs
  18. 6
      irdest-core/tests/messages.rs
  19. 6
      irdest-core/tests/subscriptions.rs
  20. 6
      irdest-core/tests/users.rs
  21. 2
      nix/irdest-rust/default.nix
  22. 30
      rpc-core/irpc-sdk/src/lib.rs
  23. 21
      rpc-core/irpc-sdk/src/parser.rs
  24. 8
      shell.nix
  25. 2
      utils/alexandria/Cargo.toml

32
Cargo.lock generated

@ -10,21 +10,7 @@ dependencies = [
]
[[package]]
name = "alexandria-api"
version = "0.1.0"
[[package]]
name = "alexandria-tags"
version = "0.2.0"
dependencies = [
"bincode",
"hex",
"serde",
"serde_json",
]
[[package]]
name = "alexandria2"
name = "alexandria"
version = "0.2.0"
dependencies = [
"alexandria-tags",
@ -45,6 +31,20 @@ dependencies = [
"tracing-futures",
]
[[package]]
name = "alexandria-api"
version = "0.1.0"
[[package]]
name = "alexandria-tags"
version = "0.2.0"
dependencies = [
"bincode",
"hex",
"serde",
"serde_json",
]
[[package]]
name = "ansi_term"
version = "0.11.0"
@ -1300,7 +1300,7 @@ dependencies = [
name = "irdest-core"
version = "0.2.0"
dependencies = [
"alexandria2",
"alexandria",
"async-std",
"async-trait",
"base64",

@ -8,17 +8,17 @@ edition = "2018"
[dependencies]
irdest-core = { path = "../../irdest-core" }
irpc-broker = { path = "../../rpc-core/irpc-broker" }
netmod-tcp = { path = "../../netmods/netmod-tcp" }
netmod-udp = { path = "../../netmods/netmod-udp" }
ratman = { path = "../../ratman" }
ratman-configure = { path = "../../ratman/configure" }
irpc-broker = { path = "../../rpc-core/irpc-broker" }
async-std = { version = "1.0", features = ["attributes"] }
clap = { version = "2.0", features = ["wrap_help", "color"] }
directories-next = "2.0"
igd = "0.11"
ipnetwork = "0.17"
pnet = "0.27"
tracing = "0.1"
tracing-subscriber = { version = "0.2", features = ["fmt", "env-filter"] }
pnet = "0.27"
ipnetwork = "0.17"

@ -2,14 +2,14 @@
use crate::cfg::Config;
use directories_next::ProjectDirs;
use irdest_core::Qaul;
use irdest_core::Irdest;
use netmod_tcp::{Endpoint, Mode};
use ratman::Router;
use std::{fs::File, io::Read, sync::Arc};
#[allow(unused)]
pub(crate) struct State {
pub qaul: Arc<Qaul>,
pub qaul: Arc<Irdest>,
pub router: Arc<Router>,
}
@ -39,7 +39,7 @@ impl State {
router.add_endpoint(ep).await;
let _dirs = ProjectDirs::from("net", "qaul", "hubd").unwrap();
let qaul = Qaul::new(Arc::clone(&router));
let qaul = Irdest::new(Arc::clone(&router));
Self { qaul, router }
}

@ -7,7 +7,7 @@ license = "AGPL-3.0"
edition = "2018"
[dependencies]
alexandria = { version = "0.2", path = "../utils/alexandria", package = "alexandria2" }
alexandria = { version = "0.2", path = "../utils/alexandria" }
ircore-types = { version = "0.1", path = "types" }
netmod-mem = { version = "0.4", path = "../netmods/netmod-mem", optional = true }
irpc-sdk = { version = "0.1", path = "../rpc-core/irpc-sdk", optional = true }

@ -2,7 +2,7 @@ use crate::{
contacts::{ContactEntry, ContactQuery},
error::Result,
users::UserAuth,
Identity, Qaul,
Identity, Irdest,
};
use serde::{Deserialize, Serialize};
@ -27,12 +27,12 @@ use serde::{Deserialize, Serialize};
/// user's local contact book, such as their nick, trust, location and
/// more.
pub struct Contacts<'chain> {
pub(crate) q: &'chain Qaul,
pub(crate) q: &'chain Irdest,
}
impl<'qaul> Contacts<'qaul> {
/// Drop this scope and return back to global `Qaul` scope
pub fn drop(&'qaul self) -> &'qaul Qaul {
impl<'ird> Contacts<'ird> {
/// Drop this scope and return back to global `Irdest` scope
pub fn drop(&'ird self) -> &'ird Irdest {
self.q
}
@ -74,8 +74,8 @@ impl<'qaul> Contacts<'qaul> {
/// this function over `Contacts::get`.
///
/// ```norun
/// # use libqaul::{Qaul, error::Result, contacts::ContactQuery};
/// # let qaul = Qaul::dummy();
/// # use irdest_core::{Irdest, error::Result, contacts::ContactQuery};
/// # let qaul = Irdest::dummy();
/// # let user = qaul.users().create("abc").await.unwrap();
/// let contacts = qaul.contacts();
/// # (|| -> Result<()> {

@ -2,7 +2,7 @@ use crate::{
error::{Error, Result},
helpers::{QueryResult, Subscription, Tag, TagSet},
messages::{Envelope, MsgUtils, RatMessageProto, TAG_UNREAD},
qaul::{Identity, Qaul},
ird::{Identity, Irdest},
services::Service,
users::UserAuth,
};
@ -22,12 +22,12 @@ fn mode_to_recp(sm: Mode) -> Recipient {
/// Interface to access messages from the network
pub struct Messages<'chain> {
pub(crate) q: &'chain crate::Qaul,
pub(crate) q: &'chain crate::Irdest,
}
impl<'qaul> Messages<'qaul> {
/// Drop this scope and return back to global `Qaul` scope
pub fn drop(&'qaul self) -> &'qaul Qaul {
impl<'ird> Messages<'ird> {
/// Drop this scope and return back to global `Irdest` scope
pub fn drop(&'ird self) -> &'ird Irdest {
self.q
}

@ -5,10 +5,10 @@
//! separate scopes, to make reasoning about association easier.
//!
//! All scopes can be constructed via the main
//! [`Qaul`](../struct.Qaul.html) type access functions.
//! [`Irdest`](../struct.Irdest.html) type access functions.
//!
//! ```
//! # let qaul = libqaul::Qaul::dummy();
//! # let qaul = irdest_core::Irdest::dummy();
//! let users = qaul.users();
//! let messages = qaul.messages();
//! let contacts = qaul.contacts();

@ -5,7 +5,7 @@ use crate::{
helpers::TagSet,
services::{MetadataMap, ServiceEvent},
users::UserAuth,
Qaul,
Irdest,
};
/// Manage service sessions and related metadata
@ -29,10 +29,10 @@ use crate::{
/// to re-implemented secure disk storage, or rely on easier
/// non-secure storage.
pub struct Services<'chain> {
pub(crate) q: &'chain Qaul,
pub(crate) q: &'chain Irdest,
}
impl<'qaul> Services<'qaul> {
impl<'ird> Services<'ird> {
/// Check if "god mode" is supported by this instance
pub fn god_mode(&self) -> bool {
true // TODO: make configurable

@ -1,21 +1,21 @@
use crate::{
error::{ratman, Result},
users::{Token, UserAuth, UserProfile, UserUpdate},
Identity, Qaul,
Identity, Irdest,
};
use serde::{Deserialize, Serialize};
/// Local user data and session management
///
/// Used entirely to namespace API endpoints on `Qaul` instance,
/// Used entirely to namespace API endpoints on `Irdest` instance,
/// without having long type identifiers.
pub struct Users<'chain> {
pub(crate) q: &'chain Qaul,
pub(crate) q: &'chain Irdest,
}
impl<'qaul> Users<'qaul> {
/// Drop this scope and return back to global `Qaul` scope
pub fn drop(&'qaul self) -> &'qaul Qaul {
impl<'ird> Users<'ird> {
/// Drop this scope and return back to global `Irdest` scope
pub fn drop(&'ird self) -> &'ird Irdest {
self.q
}

@ -1,7 +1,7 @@
use crate::{
messages::MsgUtils,
users::{Announcer, TAG_PROFILE},
Qaul,
Irdest,
};
use alexandria::utils::Tag;
use async_std::task;
@ -9,11 +9,11 @@ use ratman::{netmod::Recipient, Router};
use std::sync::Arc;
use tracing::{debug, info, warn};
/// A thread-detached discovery service running inside libqaul
/// A thread-detached discovery service running inside irdest-core
///
/// ## Required data
///
/// This internal service needs access to both the rest of the `Qaul`
/// This internal service needs access to both the rest of the `Irdest`
/// structure to access external service registries and user stores,
/// as well as the underlying `Router` of a platform to send messages
/// to and receive from.
@ -29,10 +29,10 @@ use tracing::{debug, info, warn};
pub(crate) struct Discovery;
impl Discovery {
/// Start a discovery service running inside libqaul
pub(crate) fn start(qaul: Arc<Qaul>, router: Arc<Router>) {
/// Start a discovery service running inside irdest-core
pub(crate) fn start(irdest: Arc<Irdest>, router: Arc<Router>) {
// Incoming message handler
Self::inc_handler(Arc::clone(&qaul), Arc::clone(&router));
Self::inc_handler(Arc::clone(&irdest), Arc::clone(&router));
// Handle new users
task::spawn(async move {
@ -40,9 +40,9 @@ impl Discovery {
let id = router.discover().await;
debug!(id = id.to_string().as_str(), "Received announcement!");
if !qaul.users.known_remote().await.contains(&id) {
if !irdest.users.known_remote().await.contains(&id) {
info!(id = id.to_string().as_str(), "Discovered new user!");
qaul.users
irdest.users
.insert_profile(id, vec![Tag::empty(TAG_PROFILE)])
.await;
}
@ -51,8 +51,8 @@ impl Discovery {
}
/// Spawns a thread that listens to incoming messages
#[tracing::instrument(skip(qaul, router), level = "info")]
fn inc_handler(qaul: Arc<Qaul>, router: Arc<Router>) {
#[tracing::instrument(skip(irdest, router), level = "info")]
fn inc_handler(irdest: Arc<Irdest>, router: Arc<Router>) {
task::spawn(async move {
loop {
let msg = router.next().await;
@ -68,15 +68,15 @@ impl Discovery {
// panic!("Getting an announcer message!!!!");
if let Some(profile) = Announcer::check_message(&msg) {
// If we had a previous version, generate diffs for update
if let Some(old) = qaul.users.get(msg.sender).await.ok() {
if let Some(old) = irdest.users.get(msg.sender).await.ok() {
let diff = old.generate_updates(profile);
qaul.users.modify(msg.sender, diff).await.unwrap();
irdest.users.modify(msg.sender, diff).await.unwrap();
}
continue;
}
let msg = match MsgUtils::process(msg, &qaul.users).await {
let msg = match MsgUtils::process(msg, &irdest.users).await {
Ok(msg) => Arc::new(msg),
Err(_) => {
warn!("Skipping malformed message by `{}`", sender);
@ -84,7 +84,7 @@ impl Discovery {
}
};
qaul.messages.insert_remote(recp, Arc::clone(&msg)).await;
irdest.messages.insert_remote(recp, Arc::clone(&msg)).await;
info!("Finished processing incoming message!");
}
});

@ -4,7 +4,7 @@ use super::ToJObject;
use crate::{
error::Result,
users::{UserAuth, UserUpdate},
Identity, Qaul,
Identity, Irdest,
};
use async_std::task::block_on;
@ -19,7 +19,7 @@ use std::sync::Arc;
#[no_mangle]
pub unsafe extern "C" fn create(
this: &JNIEnv,
q: Arc<Qaul>,
q: Arc<Irdest>,
handle: JString,
name: JString,
pw: JString,
@ -45,7 +45,7 @@ pub unsafe extern "C" fn create(
#[no_mangle]
pub unsafe extern "C" fn login(
env: &JNIEnv,
q: Arc<Qaul>,
q: Arc<Irdest>,
id: Identity,
pw: JString,
) -> Result<UserAuth> {
@ -53,7 +53,7 @@ pub unsafe extern "C" fn login(
block_on(async { q.users().login(id, &pw).await })
}
pub fn list<'env>(local: jboolean, env: &'env JNIEnv<'env>, q: Arc<Qaul>) -> JList<'env, 'env> {
pub fn list<'env>(local: jboolean, env: &'env JNIEnv<'env>, q: Arc<Irdest>) -> JList<'env, 'env> {
let users = block_on(async {
if local != 0 {
// a jboolean false == 0
@ -76,7 +76,7 @@ pub fn list<'env>(local: jboolean, env: &'env JNIEnv<'env>, q: Arc<Qaul>) -> JLi
})
}
pub fn get<'env>(env: &'env JNIEnv<'env>, q: Arc<Qaul>, id: Identity) -> JObject<'env> {
pub fn get<'env>(env: &'env JNIEnv<'env>, q: Arc<Irdest>, id: Identity) -> JObject<'env> {
match block_on(async { q.users().get(id).await }) {
Ok(u) => u.to_jobject(&env),
Err(_) => JObject::null(),

@ -18,7 +18,7 @@ use std::{path::Path, sync::Arc};
use tracing::{error, info};
/// An atomic reference counted pointer to a running libqaul instance
pub type QaulRef = Arc<Qaul>;
pub type IrdestRef = Arc<Irdest>;
/// Primary context structure for `libqaul`
///
@ -45,7 +45,7 @@ pub type QaulRef = Arc<Qaul>;
/// 3. Initialise services with a `libqaul` instance reference
/// 4. Your application is now ready for use
#[derive(Clone)]
pub struct Qaul {
pub struct Irdest {
/// Store available user profile data
pub(crate) users: UserStore,
@ -75,12 +75,12 @@ pub struct Qaul {
pub(crate) store: Arc<Library>,
}
impl Qaul {
impl Irdest {
/// This function exists entirely for doc tests
#[doc(hidden)]
#[allow(warnings)]
#[cfg(feature = "testing")]
pub fn dummy() -> QaulRef {
pub fn dummy() -> IrdestRef {
use tempfile;
let router = Router::new();
let temp = tempfile::tempdir().unwrap();
@ -115,7 +115,7 @@ impl Qaul {
/// application loop so to enable further API abstractions to hook
/// into the service API.
#[tracing::instrument(skip(router), level = "info")]
pub fn new(router: Arc<Router>) -> QaulRef {
pub fn new(router: Arc<Router>) -> IrdestRef {
// let store = Builder::inspect_path(store_path.into(), "").map_or_else(
// |b| match b.build() {
// Ok(s) => {

@ -54,11 +54,11 @@
//! [libqaul-sdk](../libqaul_sdk) documentation!
//!
//! ```rust,no_run
//! # async fn foo() -> libqaul::error::Result<()> {
//! # use libqaul::{helpers::ItemDiff, users::UserUpdate};
//! # async fn foo() -> irdest_core::error::Result<()> {
//! # use irdest_core::{helpers::ItemDiff, users::UserUpdate};
//! # let router = todo!();
//! use libqaul::Qaul;
//! let q = Qaul::new(router);
//! use irdest_core::Irdest;
//! let q = Irdest::new(router);
//!
//! // Create an anonymous user with a password
//! let alice = q.users().create("password alice secret keeps").await?;
@ -120,5 +120,5 @@ pub mod ffi;
pub mod rpc;
// Core state should be in the root
mod qaul;
pub use qaul::{Identity, Qaul, QaulRef};
mod ird;
pub use ird::{Identity, Irdest, IrdestRef};

@ -3,7 +3,7 @@
use crate::{
helpers::TagSet,
messages::{Message, MsgId, SigTrust},
qaul::Identity,
ird::Identity,
};
use rand::distributions::{Distribution, Standard};
use ratman::ID_LEN;

@ -12,7 +12,7 @@ use crate::{
error::Error,
types::rpc::{Capabilities, Reply, UserCapabilities, UserReply},
users::{UserAuth, UserProfile, UserUpdate},
Identity, QaulRef,
Identity, IrdestRef,
};
use async_std::{sync::Arc, task};
use irpc_sdk::{default_socket_path, error::RpcResult, io::Message, RpcSocket, Service};
@ -20,12 +20,12 @@ use std::str;
/// A pluggable RPC server that wraps around libqaul
///
/// Initialise this server with a fully initialised [`Qaul`] instance.
/// Initialise this server with a fully initialised [`Irdest`] instance.
/// You will lose access to this type once you start the RPC server.
/// Currently there is no self-management interface available via
/// qrpc.
pub struct RpcServer {
inner: QaulRef,
inner: IrdestRef,
socket: Arc<RpcSocket>,
serv: Service,
id: Identity,
@ -33,12 +33,12 @@ pub struct RpcServer {
impl RpcServer {
/// Wrapper around `new` with `default_socket_path()`
pub async fn start_default(inner: QaulRef) -> RpcResult<Arc<Self>> {
pub async fn start_default(inner: IrdestRef) -> RpcResult<Arc<Self>> {
let (addr, port) = default_socket_path();
Self::new(inner, addr, port).await
}
pub async fn new(inner: QaulRef, addr: &str, port: u16) -> RpcResult<Arc<Self>> {
pub async fn new(inner: IrdestRef, addr: &str, port: u16) -> RpcResult<Arc<Self>> {
let socket = RpcSocket::connect(addr, port).await?;
let mut serv = Service::new(

@ -6,7 +6,7 @@ use crate::types::{
};
use crate::{
error::{Error, Result},
qaul::Identity,
ird::Identity,
security::{KeyId, Keypair},
store::{FromRecord, KeyWrap, UserProfileExt},
};

@ -1,6 +1,6 @@
//! A libqaul specific harness for arbitrary API types
use libqaul::Qaul;
use irdest_core::Irdest;
use ratman_harness::{temp, Initialize, ThreePoint};
use std::{sync::Arc, time::Duration};
@ -11,8 +11,8 @@ pub async fn zzz(dur: Duration) {
async_std::task::sleep(dur).await
}
pub async fn init() -> ThreePoint<Arc<Qaul>> {
pub async fn init() -> ThreePoint<Arc<Irdest>> {
let mut tp = ThreePoint::new().await;
tp.init_with(|_, arc| Qaul::new(arc));
tp.init_with(|_, arc| Irdest::new(arc));
tp
}

@ -5,15 +5,15 @@
mod harness;
use harness::{millis, sec10, sec5, zzz};
use libqaul::{
use irdest_core::{
helpers::TagSet,
messages::{IdType, Mode, MsgQuery},
users::UserAuth,
Identity, Qaul,
Identity, Irdest,
};
use std::{sync::Arc, time::Instant};
async fn send_simple(q: &Arc<Qaul>, auth: &UserAuth, target: Identity) -> Identity {
async fn send_simple(q: &Arc<Irdest>, auth: &UserAuth, target: Identity) -> Identity {
dbg!(q
.messages()
.send(

@ -5,15 +5,15 @@
mod harness;
use harness::sec5;
use libqaul::{
use irdest_core::{
helpers::TagSet,
messages::{IdType, Mode},
users::UserAuth,
Identity, Qaul,
Identity, Irdest,
};
use std::sync::Arc;
async fn send_simple(q: &Arc<Qaul>, auth: &UserAuth, target: Identity) -> Identity {
async fn send_simple(q: &Arc<Irdest>, auth: &UserAuth, target: Identity) -> Identity {
dbg!(q
.messages()
.send(

@ -5,7 +5,7 @@
mod harness;
use harness::{sec10, sec5};
use libqaul::users::UserUpdate;
use irdest_core::users::UserUpdate;
use ircore_types::diff::ItemDiff;
#[async_std::test]
@ -70,7 +70,7 @@ async fn modify_user() {
#[ignore]
#[async_std::test]
async fn fail_delete() {
use libqaul::{users::UserAuth, Identity};
use irdest_core::{users::UserAuth, Identity};
let net = harness::init().await;
@ -144,7 +144,7 @@ async fn login_changed_pw() {
#[ignore]
#[async_std::test]
async fn get_user_profile() {
use libqaul::users::UserProfile;
use irdest_core::users::UserProfile;
let net = harness::init().await;
// Create a user

@ -51,7 +51,7 @@ naersk.buildPackage rec {
passthru.testBinaries = naersk.buildPackage {
inherit src nativeBuildInputs buildInputs SODIUM_USE_PKG_CONFIG;
cargoBuildOptions = (x: x ++ [ "--tests" "-p alexandria2" ]);
cargoBuildOptions = (x: x ++ [ "--tests" "-p alexandria" ]);
release = false;

@ -1,4 +1,4 @@
//! A toolkit for writing clients on the qrpc message bus. This bus
//! A toolkit for writing clients on the irpc message bus. This bus
//! is the backbone of the [qaul.net](https://qaul.net) service
//! ecosystem. With it you can create applications (called
//! "services") that interact with a `libqaul` instance, and other
@ -19,7 +19,7 @@
//!
//! ## Using this sdk
//!
//! In order to interact with a running [`qrpc-broker`] instance your
//! In order to interact with a running [`irpc-broker`] instance your
//! service needs to register itself and it's capabilities.
//!
//! First your service needs a place to save some state, composing
@ -32,13 +32,13 @@
//! table, and you get assigned a hash-id to identify you in future
//! interactions.
//!
//! [`qrpc-broker`]: ../qrpc_broker/index.html
//! [`irpc-broker`]: ../irpc_broker/index.html
//! [`Service`]: ./struct.Service.html
//! [`RpcSocket`]: ./struct.RpcSocket.html
//!
//! ```
//! # async fn foo() -> Result<(), qrpc_sdk::error::RpcError> {
//! use qrpc_sdk::{Service, RpcSocket, default_socket_path};
//! # async fn foo() -> Result<(), irpc_sdk::error::RpcError> {
//! use irpc_sdk::{Service, RpcSocket, default_socket_path};
//!
//! let mut serv = Service::new("com.example.myapp", 1, "A simple app");
//! let (addr, port) = default_socket_path();
@ -55,8 +55,8 @@
//! initialiser.
//!
//! ```
//! # async fn foo() -> Result<(), qrpc_sdk::error::RpcError> {
//! # use qrpc_sdk::{Service, RpcSocket, default_socket_path};
//! # async fn foo() -> Result<(), irpc_sdk::error::RpcError> {
//! # use irpc_sdk::{Service, RpcSocket, default_socket_path};
//! # let mut serv = Service::new("com.example.myapp", 1, "A simple app");
//! # let (addr, port) = default_socket_path();
//! # let sock = RpcSocket::connect(addr, port).await?;
@ -70,7 +70,7 @@
//! This will establish a connection with the `libqaul` component and
//! verifies it's capability set. This mechanism is provided by the
//! [`ServiceConnector`]. Your service will also have to implement
//! this mechanism to be usable by other services on the qrpc bus.
//! this mechanism to be usable by other services on the irpc bus.
//!
//! [`ServiceConnector`]: ./trait.ServiceConnector.html
//!
@ -78,8 +78,8 @@
//! component. You can get a copy of it via your service handle.
//!
//! ```
//! # async fn foo() -> Result<(), qrpc_sdk::error::RpcError> {
//! # use qrpc_sdk::{Service, RpcSocket, default_socket_path};
//! # async fn foo() -> Result<(), irpc_sdk::error::RpcError> {
//! # use irpc_sdk::{Service, RpcSocket, default_socket_path};
//! # let mut serv = Service::new("com.example.myapp", 1, "A simple app");
//! # let (addr, port) = default_socket_path();
//! # let sock = RpcSocket::connect(addr, port).await?;
@ -116,9 +116,9 @@ pub(crate) mod cap_capnp {
include!(concat!(env!("OUT_DIR"), "/schema/cap_capnp.rs"));
}
/// qrpc message types
/// irpc message types
///
/// This interface is exposed to let other parts of the qrpc ecosystem
/// This interface is exposed to let other parts of the irpc ecosystem
/// parse and generate these types. When using this library directly,
/// try to avoid using them. Use the main type interface documented
/// in the root of the crate instead.
@ -128,7 +128,7 @@ pub mod types {
pub use crate::types_capnp::service;
}
/// qrpc message types
/// irpc message types
///
/// As with the data types used by this crate, try to avoid using them
/// directly. Instead use the main API of the crate which invoces
@ -150,5 +150,5 @@ pub use identity::Identity;
pub use service::{Service, ServiceConnector};
pub use socket::{default_socket_path, RpcSocket};
/// The address of the qrpc broker itself
pub const BROKER_ADDRESS: &'static str = "org.qaul._broker";
/// The address of the irpc broker itself
pub const BROKER_ADDRESS: &'static str = "org.irdest._broker";

@ -1,9 +1,10 @@
//! An I/O abstraction module for the qrpc system
//! An I/O abstraction module for the irpc system
//!
//! The qrpc system heavily builds on capnproto as an exchange and RPC
//! The irpc system heavily builds on capnproto as an exchange and RPC
//! format. Unfortunately the capnproto-rs interface is pretty shit
//! (this is rude, I know but it's just not great...). Having to
//! interact with it to write services for qaul.net might be a dealbreaker.
//! interact with it to write services for irdest might be a
//! dealbreaker.
//!
//! And so... this module tries to abstract as much of the low-level
//! ugliness away. Instead, you pass it a buffer with a message, and
@ -55,8 +56,8 @@ impl<'s, T: FromPointerReader<'s>> MsgReader<'s, T> {
/// `service::Reader`.
///
/// ```
/// # use qrpc_sdk::parser::Result;
/// use qrpc_sdk::{parser::MsgReader, types::service};
/// # use irpc_sdk::parser::Result;
/// use irpc_sdk::{parser::MsgReader, types::service};
///
/// # fn run_code() -> Result<()> {
/// # let buf = vec![];
@ -73,9 +74,9 @@ impl<'s, T: FromPointerReader<'s>> MsgReader<'s, T> {
/// defined in this crate.
///
/// ```
/// use qrpc_sdk::{parser::MsgReader, error::RpcError, rpc::capabilities::{Reader, Which}};
/// use irpc_sdk::{parser::MsgReader, error::RpcError, rpc::capabilities::{Reader, Which}};
/// # fn foo() -> Result<(), RpcError> {
/// # let reader = qrpc_sdk::builders::parse_rpc_msg(vec![]).unwrap();
/// # let reader = irpc_sdk::builders::parse_rpc_msg(vec![]).unwrap();
///
/// // Get the `reader` by calling `builders::parse_rpc_msg(...)`
/// let r: Reader = reader.get_root().unwrap();
@ -88,18 +89,18 @@ impl<'s, T: FromPointerReader<'s>> MsgReader<'s, T> {
/// # Ok(())
/// # }
///
/// use qrpc_sdk::rpc::{register, unregister, upgrade};
/// use irpc_sdk::rpc::{register, unregister, upgrade};
///
/// fn handle_register(_: register::Reader) { /* ... */}
/// fn handle_unregister(_: unregister::Reader) { /* ... */}
/// fn handle_upgrade(_: upgrade::Reader) { /* ... */}
/// ```
///
/// The above code can be found in the [qrpc-broker] crate. Your
/// The above code can be found in the [irpc-broker] crate. Your
/// own service code will differ, but this should give you a good
/// idea how to start!
///
/// [qrpc-broker]: https://docs.qaul.net/api/qrpc_broker/index.html
/// [irpc-broker]: https://docs.irde.st/api/irpc_broker/index.html
pub fn get_root(&'s self) -> Result<T> {
self.r.get_root()
}

@ -1,10 +1,16 @@
/** This shell derivation fetches all required dependencies to hack on Irdest
*
* You may want to comment-out the bottom section to ignore Android
* platform dependencies.
*/
with import <nixpkgs> {
config.android_sdk.accept_license = true;
config.allowUnfree = true;
};
stdenv.mkDerivation {
name = "qaul";
name = "irdest-dev";
buildInputs = with pkgs; [
# General rust stuff

@ -1,5 +1,5 @@
[package]
name = "alexandria2"
name = "alexandria"
description = "An encrypted document-oriented database with tag based query support"
version = "0.2.0"
authors = ["Katharina Fey <kookie@spacekookie.de>"]

Loading…
Cancel
Save