nu_protocol/plugin/
signature.rs1use crate::{PluginExample, Signature};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
6pub struct PluginSignature {
7 pub sig: Signature,
8 pub examples: Vec<PluginExample>,
9}
10
11impl PluginSignature {
12 pub fn new(sig: Signature, examples: Vec<PluginExample>) -> Self {
13 Self { sig, examples }
14 }
15
16 pub fn build(name: impl Into<String>) -> PluginSignature {
18 let sig = Signature::new(name.into()).add_help();
19 Self::new(sig, vec![])
20 }
21}