pub struct CommandList { /* private fields */ }Expand description
Create a command list able to be run via sway ipc
Implementations§
Source§impl CommandList
impl CommandList
Sourcepub fn get_commands(&self) -> &[Command]
pub fn get_commands(&self) -> &[Command]
Get the commands
Sourcepub fn command(self, command: impl Into<Command>) -> Self
pub fn command(self, command: impl Into<Command>) -> Self
let cmd = CommandList::default()
.command("workspace 5")
.command(SubCommand::Border(Border::None))
.command(
CriteriaCommand::default()
.criteria(Criteria::Floating)
.command(SubCommand::Floating(EnDisTog::Disable)),
)
.command(CriterialessCommand::Bindsym(
Default::default(),
SymKey::key("a"),
SubCommand::Exit.into(),
));
let cmd: &str = cmd.as_ref();
assert_eq!(
normalize_whitespace(cmd),
"workspace 5;border none;[floating]floating disable;bindsym a exit"
);Trait Implementations§
Source§impl<__AsRefT: ?Sized> AsRef<__AsRefT> for CommandList
impl<__AsRefT: ?Sized> AsRef<__AsRefT> for CommandList
Source§impl Default for CommandList
impl Default for CommandList
Source§fn default() -> CommandList
fn default() -> CommandList
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CommandList
impl RefUnwindSafe for CommandList
impl Send for CommandList
impl Sync for CommandList
impl Unpin for CommandList
impl UnwindSafe for CommandList
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