Initial checkin

This commit is contained in:
2020-05-08 20:38:30 +01:00
parent b93ba79323
commit 5328ae9bd6
133 changed files with 17884 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
use crate::telepathy;
use dbus::{arg, tree};
use std::collections::HashMap;
#[derive(Debug)]
pub struct ConnectionManager {}
#[derive(Copy, Clone, Default, Debug)]
pub struct CMData;
impl dbus::tree::DataType for CMData {
type Tree = ();
type Property = ();
type Interface = ();
type Method = ();
type Signal = ();
type ObjectPath = std::sync::Arc<ConnectionManager>;
}
const PROTO: &'static str = "delta";
pub type Dict = HashMap<String, arg::Variant<Box<dyn arg::RefArg + 'static>>>;
impl telepathy::ConnectionManager for ConnectionManager {
fn get_parameters(
&self,
protocol: &str,
) -> Result<
Vec<(
String,
u32,
String,
arg::Variant<Box<dyn arg::RefArg + 'static>>,
)>,
tree::MethodErr,
> {
Err(tree::MethodErr::no_arg()) // FIXME: should be NotImplemented
}
fn list_protocols(&self) -> Result<Vec<String>, tree::MethodErr> {
Ok(vec![PROTO.to_string()])
}
fn request_connection(
&self,
protocol: &str,
parameters: HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
) -> Result<(String, dbus::Path<'static>), tree::MethodErr> {
Err(tree::MethodErr::no_arg())
}
fn protocols(&self) -> Result<HashMap<String, Dict>, tree::MethodErr> {
let mut hm = HashMap::new();
let mut props = Dict::new();
hm.insert(PROTO.to_string(), props);
Ok(hm)
}
fn interfaces(&self) -> Result<Vec<String>, tree::MethodErr> {
Err(tree::MethodErr::no_arg())
}
}

2
src/padfoot/protocol.rs Normal file
View File

@@ -0,0 +1,2 @@
pub struct Protocol {}