pub struct ColorArgument { /* private fields */ }Implementations§
Source§impl ColorArgument
impl ColorArgument
Sourcepub fn new(r: u8, g: u8, b: u8, a: u8) -> Self
pub fn new(r: u8, g: u8, b: u8, a: u8) -> Self
Examples found in repository?
examples/notify_error.rs (line 23)
8fn main() {
9 let conn = HyprlandConnection::current().unwrap();
10
11 let args = std::env::args().collect::<Vec<_>>();
12 if args.len() < 2 {
13 eprintln!("Not enough arguments!");
14 return;
15 }
16 let fav_window: String = args[1].to_string();
17
18 conn.send_command_sync(&focus_window(WindowArgument::Class(fav_window.clone())))
19 .unwrap();
20
21 if conn.get_sync::<Window>().unwrap().class != fav_window {
22 conn.send_command_sync(&set_error(
23 ColorArgument::new(255, 40, 40, 255),
24 "Could not focus your favourite window.".to_string(),
25 ))
26 .unwrap();
27 } else {
28 conn.send_command_sync(¬ify(
29 NotifyIconArgument::Ok,
30 10000,
31 ColorArgument::new(40, 200, 120, 255),
32 "Everything went well!".to_string(),
33 ))
34 .unwrap();
35 }
36}Trait Implementations§
Source§impl Argument for ColorArgument
impl Argument for ColorArgument
fn to_argument_string(&self) -> String
Source§impl Clone for ColorArgument
impl Clone for ColorArgument
Source§fn clone(&self) -> ColorArgument
fn clone(&self) -> ColorArgument
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ColorArgument
impl RefUnwindSafe for ColorArgument
impl Send for ColorArgument
impl Sync for ColorArgument
impl Unpin for ColorArgument
impl UnwindSafe for ColorArgument
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