pub struct I3 { /* private fields */ }
Expand description
Newtype wrapper for UnixStream
that implements i3’s IPC
Implementations§
Source§impl I3
impl I3
pub async fn send_msg_body<P>(&mut self, msg: Msg, payload: P) -> Result<()>
pub async fn send_msg(&mut self, msg: Msg) -> Result<()>
Sourcepub async fn read_msg<D>(&mut self) -> Result<MsgResponse<D>>where
D: DeserializeOwned,
pub async fn read_msg<D>(&mut self) -> Result<MsgResponse<D>>where
D: DeserializeOwned,
Receive some message from the socket. Holds a Msg
type and payload
Sourcepub async fn read_event(&mut self) -> Result<Event>
pub async fn read_event(&mut self) -> Result<Event>
Like read_msg
but for event::Event
Sourcepub async fn send_read<P, D>(
&mut self,
msg: Msg,
payload: P,
) -> Result<MsgResponse<D>>
pub async fn send_read<P, D>( &mut self, msg: Msg, payload: P, ) -> Result<MsgResponse<D>>
Send a Msg
and payload and receive a response. Convenience function
over send_msg
and read_msg
Sourcepub async fn subscribe<E>(&mut self, events: E) -> Result<Success>
pub async fn subscribe<E>(&mut self, events: E) -> Result<Success>
Returns a Future that will send a Subscribe message to i3 along with a list of events to listen to.
Sourcepub fn listen(self) -> EventStream
pub fn listen(self) -> EventStream
Provides a type that implements Stream
so you can await
events in a
loop
Sourcepub async fn run_command<S: AsRef<str>>(
&mut self,
payload: S,
) -> Result<Vec<Success>>
pub async fn run_command<S: AsRef<str>>( &mut self, payload: S, ) -> Result<Vec<Success>>
Run an arbitrary command on i3. Response is a Vec
of success
true/false.
Sourcepub async fn get_workspaces(&mut self) -> Result<Workspaces>
pub async fn get_workspaces(&mut self) -> Result<Workspaces>
Future for getting the current Workspaces, sends Workspaces
Sourcepub async fn get_outputs(&mut self) -> Result<Outputs>
pub async fn get_outputs(&mut self) -> Result<Outputs>
Sourcepub async fn get_bar_ids(&mut self) -> Result<BarIds>
pub async fn get_bar_ids(&mut self) -> Result<BarIds>
Sourcepub async fn get_version(&mut self) -> Result<Version>
pub async fn get_version(&mut self) -> Result<Version>
Get i3 version
Sourcepub async fn get_binding_modes(&mut self) -> Result<BindingModes>
pub async fn get_binding_modes(&mut self) -> Result<BindingModes>
Future to get BindingModes, sends BindingModes
Sourcepub async fn get_binding_state(&mut self) -> Result<BindingState>
pub async fn get_binding_state(&mut self) -> Result<BindingState>
Future to get BindingState, sends BindingState
Trait Implementations§
Auto Trait Implementations§
impl Freeze for I3
impl RefUnwindSafe for I3
impl Send for I3
impl Sync for I3
impl Unpin for I3
impl UnwindSafe for I3
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more