aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2022-10-22 16:22:27 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2022-10-22 16:22:27 +0200
commitff5f6bd8bfb1afd482a01d900cc37129fc06caa0 (patch)
tree15c99faf54fabf0c73268910d8ca11b22c524fd4
parent6fca060dcc17dc0a81061cd0b416cf598ee6b573 (diff)
derive/require clone and debug for all calls and responses
-rw-r--r--src/call/account.rs2
-rw-r--r--src/call/mod.rs2
-rw-r--r--src/response/mod.rs1
3 files changed, 4 insertions, 1 deletions
diff --git a/src/call/account.rs b/src/call/account.rs
index 04fe52d..2cd89d5 100644
--- a/src/call/account.rs
+++ b/src/call/account.rs
@@ -3,6 +3,7 @@ use super::Call;
use std::collections::BTreeMap;
// Contains login information. Used to create an API session.
+#[derive(Clone, Debug)]
pub(crate) struct Login<'a> {
pub(crate) user: &'a str,
pub(crate) pass: &'a str,
@@ -33,6 +34,7 @@ impl Call for Login<'_> {
// Contains no information. This just signals to the server
// that it should end the session.
+#[derive(Clone, Debug)]
pub(crate) struct Logout;
impl From<Logout> for xmlrpc::Value {
diff --git a/src/call/mod.rs b/src/call/mod.rs
index 51fca5a..6b44a16 100644
--- a/src/call/mod.rs
+++ b/src/call/mod.rs
@@ -1,5 +1,5 @@
// A call to the API.
-pub trait Call: Into<xmlrpc::Value> {
+pub trait Call: Clone + std::fmt::Debug + Into<xmlrpc::Value> {
fn method_name(&self) -> &'static str;
fn expected(&self) -> &'static [i32];
}
diff --git a/src/response/mod.rs b/src/response/mod.rs
index 8d95dfb..4407c10 100644
--- a/src/response/mod.rs
+++ b/src/response/mod.rs
@@ -3,6 +3,7 @@ use std::collections::BTreeMap;
/// A Response to an API call including status and data.
/// Data is guaranteed to be a `Struct`.
/// [`Struct`]: xmlrpc::Value::Struct
+#[derive(Clone, Debug)]
pub struct Response {
pub status: i32,
pub data: BTreeMap<String, xmlrpc::Value>,