pub fn put_string(&mut self, s: impl AsRef<str>) {
        let s = s.as_ref();
        put_string_impl(s);

        fn put_string_impl(s: &str) {
            unsafe {
                let nsstring = util::make_nsstring(s);
                let pasteboard: id = msg_send![class!(NSPasteboard), generalPasteboard];
                let _: NSInteger = msg_send![pasteboard, clearContents];
                let result: BOOL =
                    msg_send![pasteboard, setString: nsstring forType: NSPasteboardTypeString];
                if result != YES {
                    tracing::warn!("failed to set clipboard");
                }
            }
        }
    }
/// Put a string onto the system clipboard.
Put a string onto the system clipboard.
Put a string onto the system clipboard .
pub fn put_string(&mut self, s: impl AsRef<str>) {
        let s = s.as_ref();
        put_string_impl(s);
        fn put_string_impl(s: &str) {
            unsafe {
                let nsstring = util::make_nsstring(s);
                let pasteboard: id = msg_send![class!(NSPasteboard), generalPasteboard];
                let _: NSInteger = msg_send![pasteboard, clearContents];
                let result: BOOL =
                    msg_send![pasteboard, setString: nsstring forType: NSPasteboardTypeString];
                if result != YES {
                    tracing::warn!("failed to set clipboard");
                }
            }
        }
    }
pub fn put_string ( & mut self , s : impl AsRef < str > ) { let s = s . as_ref ( ) ; put_string_impl ( s ) ; fn put_string_impl ( s : & str ) { unsafe { let nsstring = util :: make_nsstring ( s ) ; let pasteboard : id = msg_send ! [ class ( NSPasteboard ) generalPasteboard ] ; let _ : NSInteger = msg_send ! [ pasteboard clearContents ] ; let result : BOOL = msg_send ! [ pasteboard setString nsstring forType NSPasteboardTypeString ] ; if result != YES { tracing :: warn ! ( " " ) ; } } } }
Put a string onto the system clipboard.
Put a string onto the system clipboard .
&mut self
s
impl AsRef<str>
&mut self
s
impl AsRef<str>