[][src]Struct i3_ipc::I3Stream

pub struct I3Stream(_);

I3Stream will hold the underlying UnixStream that communicates with i3

Implementations

impl I3Stream[src]

pub fn conn_sub<E>(events: E) -> Result<Self> where
    E: AsRef<[Subscribe]>, 
[src]

Connect & subscribe in one method

pub fn subscribe<E>(&mut self, events: E) -> Result<Success> where
    E: AsRef<[Subscribe]>, 
[src]

sends a subscribe message to i3 with a json encoded array of types of events to listen to

pub fn listen(&mut self) -> I3Iter[src]

Returns a type that implements Iterator, allowing us to listen to events

pub fn iter(&mut self) -> I3Iter[src]

same as listen

pub fn send_msg<P>(&mut self, msg: Msg, payload: P) -> Result<usize> where
    P: AsRef<str>, 
[src]

Send a message and payload, used for get_* commands and run_command

pub fn receive_msg<D: DeserializeOwned>(&mut self) -> Result<MsgResponse<D>>[src]

Receive some message from the socket. Holds a Msg type and payload

pub fn receive_event(&mut self) -> Result<Event>[src]

Like receive_msg but for event::Event

pub fn send_receive<P, D>(
    &mut self,
    msg: Msg,
    payload: P
) -> Result<MsgResponse<D>> where
    P: AsRef<str>,
    D: DeserializeOwned
[src]

Send a Msg and payload and receive a response. Convenience function over send_msg and receive_msg

pub fn run_command<S: AsRef<str>>(&mut self, payload: S) -> Result<Vec<Success>>[src]

Run an arbitrary command on i3.

pub fn get_workspaces(&mut self) -> Result<Workspaces>[src]

Get active workspaces

pub fn get_outputs(&mut self) -> Result<Outputs>[src]

Get active workspaces

pub fn get_tree(&mut self) -> Result<Node>[src]

Get tree of all Nodes in i3

pub fn get_marks(&mut self) -> Result<Marks>[src]

Get marks

pub fn get_bar_ids(&mut self) -> Result<BarIds>[src]

Get your active bar ids

pub fn get_bar_config<S: AsRef<str>>(&mut self, bar_id: S) -> Result<BarConfig>[src]

Get bar config by id (get_bar_ids)

pub fn get_version(&mut self) -> Result<Version>[src]

Get i3 version and config location

pub fn get_binding_modes(&mut self) -> Result<BindingModes>[src]

Get i3 binding modes

pub fn get_config(&mut self) -> Result<Config>[src]

Get i3 config

pub fn get_tick(&mut self) -> Result<Success>[src]

Convenience over msg::Msg::Tick and response

pub fn get_sync(&mut self) -> Result<Success>[src]

Convenience over msg::Msg::Sync and response

Trait Implementations

impl Debug for I3Stream[src]

impl Read for I3Stream[src]

impl Write for I3Stream[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> I3IPC for T where
    T: I3Protocol + Read + Write
[src]

impl<T> I3Protocol for T where
    T: Read + Write
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.