1extern crate core;
2
3mod command;
4mod connection;
5mod error;
6mod memento;
7
8pub use self::{command::*, error::*, memento::*};
9use std::fmt::Debug;
10
11use tokio::net::ToSocketAddrs;
12
13pub type Result<T> = std::result::Result<T, MementoError>;
14
15pub trait ToCommandResponse: Default {
16 fn create<T>(frames: Vec<T>, cmd: Command) -> Result<Option<Self>>
17 where
18 T: ToString + Debug + Default;
19}
20
21pub async fn new<A: ToSocketAddrs>(addr: A) -> Result<Memento> {
33 Memento::connect(addr).await
34}