[][src]Struct async_i3ipc::I3

pub struct I3 { /* fields omitted */ }

Newtype wrapper for UnixStream that implements i3's IPC

Implementations

impl I3[src]

pub async fn connect() -> Result<Self>[src]

Connects to I3 over UnixStream

pub async fn send_msg_body<P, '_>(
    &'_ mut self,
    msg: Msg,
    payload: P
) -> Result<()> where
    P: AsRef<str>, 
[src]

pub async fn send_msg<'_>(&'_ mut self, msg: Msg) -> Result<()>[src]

pub async fn read_msg<D, '_>(&'_ mut self) -> Result<MsgResponse<D>> where
    D: DeserializeOwned
[src]

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

pub async fn read_event<'_>(&'_ mut self) -> Result<Event>[src]

Like read_msg but for event::Event

pub async fn send_read<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 read_msg

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

Returns a Future that will send a Subscribe message to i3 along with a list of events to listen to.

pub fn listen(self) -> EventStream[src]

Provides a type that implements Stream so you can await events in a loop

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

Run an arbitrary command on i3. Response is a Vec of success true/false.

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

Future for getting the current Workspaces, sends Workspaces

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

Future that gets all Outputs, sends Outputs

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

Future to get complete Node, sends Tree

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

Get all Marks, sends Marks

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

Future to get all BarIds, sends BarConfig

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

Future to get configs associated with a bar id responds with BarConfig, sends BarConfig

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

Get i3 version

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

Future to get BindingModes, sends BindingModes

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

Future for Config, sends Config

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

Future sends Tick

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

Future Sync

Trait Implementations

impl Debug for I3[src]

Auto Trait Implementations

impl RefUnwindSafe for I3

impl Send for I3

impl Sync for I3

impl Unpin for I3

impl UnwindSafe for I3

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, 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.