pub struct Plugin {
pub name: String,
pub url: String,
pub version: String,
}Expand description
插件配置
注意:插件应无状态化
Fields§
§name: String插件名称,全局唯一
url: String下载地址
- 相对地址:从控制台下载,如
/file/download/xxx.so - 绝对地址:从给定的地址下载,如
https://xxx.com/xxx.so
version: String插件版本,只增不减的语义化版本号。
Implementations§
Source§impl Plugin
impl Plugin
Sourcepub fn build_url_with_console(&self, console_addr: &str) -> String
pub fn build_url_with_console(&self, console_addr: &str) -> String
通过控制台地址,构建下载地址。
插件地址可以是相对地址和绝对地址,如果是相对地址,则从控制台下载,否则直接下载。
Sourcepub fn is_relative_download_url(&self) -> bool
pub fn is_relative_download_url(&self) -> bool
判断插件url是否是相对地址。
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Plugin
impl<'de> Deserialize<'de> for Plugin
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Plugin
impl StructuralPartialEq for Plugin
Auto Trait Implementations§
impl Freeze for Plugin
impl RefUnwindSafe for Plugin
impl Send for Plugin
impl Sync for Plugin
impl Unpin for Plugin
impl UnsafeUnpin for Plugin
impl UnwindSafe for Plugin
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