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