Create skeleton plugin
This commit is contained in:
parent
4eff91c9e6
commit
dad395d252
|
@ -4,6 +4,9 @@ version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
[lib]
|
||||||
|
name = "weechat_notify"
|
||||||
|
crate-type = ["cdylib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
weechat = "0.4.0"
|
weechat = "0.4.0"
|
||||||
|
|
28
src/lib.rs
Normal file
28
src/lib.rs
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
use weechat::plugin;
|
||||||
|
use weechat::Args;
|
||||||
|
use weechat::Plugin;
|
||||||
|
use weechat::Weechat;
|
||||||
|
|
||||||
|
struct WeechatNotify;
|
||||||
|
|
||||||
|
impl Plugin for WeechatNotify {
|
||||||
|
fn init(_: &Weechat, _: Args) -> Result<Self, ()> {
|
||||||
|
Weechat::print("Hello from weechat-notify!");
|
||||||
|
Ok(Self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Drop for WeechatNotify {
|
||||||
|
fn drop(&mut self) {
|
||||||
|
Weechat::print("Bye from weechat-notify!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugin! {
|
||||||
|
WeechatNotify,
|
||||||
|
name: "weechat-notify",
|
||||||
|
author: "Yash Karandikar <yash@karx.xyz>",
|
||||||
|
description: "Notification plugin for weechat written in Rust",
|
||||||
|
version: "0.1.0",
|
||||||
|
license: "0BSD"
|
||||||
|
}
|
|
@ -1,3 +0,0 @@
|
||||||
fn main() {
|
|
||||||
println!("Hello, world!");
|
|
||||||
}
|
|
Loading…
Reference in a new issue