[−][src]Struct i3_ipc::I3Stream
I3Stream
will hold the underlying UnixStream that communicates with i3
Methods
impl I3Stream
[src]
pub fn conn_sub<E>(events: E) -> Result<Self> where
E: AsRef<[Subscribe]>,
[src]
E: AsRef<[Subscribe]>,
Connect & subscribe in one method
pub fn subscribe<E>(&mut self, events: E) -> Result<Success> where
E: AsRef<[Subscribe]>,
[src]
E: AsRef<[Subscribe]>,
sends a subscribe message to i3 with a json encoded array of types of events to listen to
ⓘImportant traits for I3Iter<'a>pub fn listen(&mut self) -> I3Iter
[src]
Returns a type that implements Iterator
, allowing us to listen to
events
ⓘImportant traits for I3Iter<'a>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]
P: AsRef<str>,
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]
&mut self,
msg: Msg,
payload: P
) -> Result<MsgResponse<D>> where
P: AsRef<str>,
D: DeserializeOwned,
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 Node
s 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]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut]) -> Result<usize, Error>
1.36.0[src]
unsafe fn initializer(&self) -> Initializer
[src]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn bytes(self) -> Bytes<Self>
1.0.0[src]
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read,
1.0.0[src]
R: Read,
fn take(self, limit: u64) -> Take<Self>
1.0.0[src]
impl Write for I3Stream
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn flush(&mut self) -> Result<()>
[src]
fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>
1.36.0[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
Auto Trait Implementations
impl Send for I3Stream
impl Sync for I3Stream
impl Unpin for I3Stream
impl UnwindSafe for I3Stream
impl RefUnwindSafe for I3Stream
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> I3Protocol for T where
T: Read + Write,
[src]
T: Read + Write,
const MAGIC: &'static str
[src]
fn _encode_msg<P>(&self, msg: Msg, payload: Option<P>) -> Vec<u8> where
P: AsRef<str>,
[src]
P: AsRef<str>,
fn encode_msg(&self, msg: Msg) -> Vec<u8>
[src]
fn encode_msg_body<P>(&self, msg: Msg, payload: P) -> Vec<u8> where
P: AsRef<str>,
[src]
P: AsRef<str>,
fn encode_msg_json<P>(&self, msg: Msg, payload: P) -> Result<Vec<u8>, Error> where
P: Serialize,
[src]
P: Serialize,
fn decode_event(evt_type: u32, payload: Vec<u8>) -> Result<Event, Error>
[src]
impl<T> I3IPC for T where
T: I3Protocol + Read + Write,
[src]
T: I3Protocol + Read + Write,