Struct swayipc_async::Connection
source · pub struct Connection(/* private fields */);
Implementations§
source§impl Connection
impl Connection
sourcepub async fn run_command<T: AsRef<str>>(
&mut self,
payload: T
) -> Fallible<Vec<Fallible<()>>>
pub async fn run_command<T: AsRef<str>>( &mut self, payload: T ) -> Fallible<Vec<Fallible<()>>>
Runs the payload as sway commands.
sourcepub async fn get_workspaces(&mut self) -> Fallible<Vec<Workspace>>
pub async fn get_workspaces(&mut self) -> Fallible<Vec<Workspace>>
Get the list of current workspaces.
sourcepub async fn subscribe<T: AsRef<[EventType]>>(
self,
events: T
) -> Fallible<EventStream>
pub async fn subscribe<T: AsRef<[EventType]>>( self, events: T ) -> Fallible<EventStream>
Subscribe the IPC connection to the events listed in the payload.
sourcepub async fn get_outputs(&mut self) -> Fallible<Vec<Output>>
pub async fn get_outputs(&mut self) -> Fallible<Vec<Output>>
Get the list of current outputs.
sourcepub async fn get_marks(&mut self) -> Fallible<Vec<String>>
pub async fn get_marks(&mut self) -> Fallible<Vec<String>>
Get the names of all the marks currently set.
sourcepub async fn get_bar_ids(&mut self) -> Fallible<Vec<String>>
pub async fn get_bar_ids(&mut self) -> Fallible<Vec<String>>
Get a list of bar config names.
sourcepub async fn get_bar_config<T: AsRef<str>>(
&mut self,
id: T
) -> Fallible<BarConfig>
pub async fn get_bar_config<T: AsRef<str>>( &mut self, id: T ) -> Fallible<BarConfig>
Get the specified bar config.
sourcepub async fn get_version(&mut self) -> Fallible<Version>
pub async fn get_version(&mut self) -> Fallible<Version>
Get the version of sway that owns the IPC socket.
sourcepub async fn get_binding_modes(&mut self) -> Fallible<Vec<String>>
pub async fn get_binding_modes(&mut self) -> Fallible<Vec<String>>
Get the list of binding mode names.
sourcepub async fn get_config(&mut self) -> Fallible<Config>
pub async fn get_config(&mut self) -> Fallible<Config>
Returns the config that was last loaded.
sourcepub async fn send_tick<T: AsRef<str>>(&mut self, payload: T) -> Fallible<bool>
pub async fn send_tick<T: AsRef<str>>(&mut self, payload: T) -> Fallible<bool>
Sends a tick event with the specified payload.
sourcepub async fn get_binding_state(&mut self) -> Fallible<String>
pub async fn get_binding_state(&mut self) -> Fallible<String>
Request the current binding state, e.g. the currently active binding mode name.
sourcepub async fn get_inputs(&mut self) -> Fallible<Vec<Input>>
pub async fn get_inputs(&mut self) -> Fallible<Vec<Input>>
Get the list of input devices.
Trait Implementations§
source§impl Debug for Connection
impl Debug for Connection
source§impl From<Async<UnixStream>> for Connection
impl From<Async<UnixStream>> for Connection
source§fn from(unix_stream: Async<UnixStream>) -> Self
fn from(unix_stream: Async<UnixStream>) -> Self
Converts to this type from the input type.
source§impl From<Connection> for Async<UnixStream>
impl From<Connection> for Async<UnixStream>
source§fn from(connection: Connection) -> Self
fn from(connection: Connection) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
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