way_cooler_ipc/
command.rs

1//! A client which sends commands to way cooler
2
3use std::convert::AsRef;
4use std::path::Path;
5use std::io::{Read, Write};
6use std::io::Result as IOResult;
7use std::io::Error as IOError;
8
9use client::SocketClient;
10use message::{Command, CommandResult};
11
12/// Represents a client which can be used to send commands
13pub struct CommandClient(SocketClient);
14
15impl CommandClient {
16    /// Connect this client to a socket at the given path
17    pub fn connect<P: AsRef<Path>>(path: P) -> IOResult<CommandClient> {
18        SocketClient::connect(path).map(|s| CommandClient(s))
19    }
20
21    /// Sends a commmand to IPC and returns the result.
22    pub fn send(command: Command) -> CommandResult {
23        unimplemented!()
24    }
25}