|
|
@ -13,16 +13,18 @@ use tokio::io::AsyncReadExt;
|
|
|
|
pub struct FilesNamespace;
|
|
|
|
pub struct FilesNamespace;
|
|
|
|
|
|
|
|
|
|
|
|
impl NamespaceProvider for FilesNamespace {
|
|
|
|
impl NamespaceProvider for FilesNamespace {
|
|
|
|
fn name() -> String {
|
|
|
|
fn name() -> &'static str {
|
|
|
|
String::from("files")
|
|
|
|
"files"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn register(handler: &mut EventHandler) {
|
|
|
|
fn register(handler: &mut EventHandler) {
|
|
|
|
handler.on("all_files", callback!(Self::all_files));
|
|
|
|
events!(handler,
|
|
|
|
handler.on("add_file", callback!(Self::add_file));
|
|
|
|
"all_files" => Self::all_files,
|
|
|
|
handler.on("read_file", callback!(Self::read_file));
|
|
|
|
"add_file" => Self::add_file,
|
|
|
|
handler.on("get_thumbnails", callback!(Self::thumbnails));
|
|
|
|
"read_file" => Self::read_file,
|
|
|
|
handler.on("read_thumbnail", callback!(Self::read_thumbnail));
|
|
|
|
"get_thumbnails" => Self::thumbnails,
|
|
|
|
|
|
|
|
"read_thumbnail" => Self::read_thumbnail
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|