pub struct AddonManifest {
pub name: String,
pub title: String,
pub identifier: String,
pub icon: String,
pub author: String,
pub version: String,
pub admin: String,
pub status: i64,
pub addon_path: PathBuf,
}Expand description
插件清单 — 对齐 think\Addons::getInfo()
插件清单信息(对齐 PHP think\Addons::getInfo() 返回的 $info 数组)
Fields§
§name: String插件标识(对齐 $info['name'])
title: String插件标题(对齐 $info['title'])
identifier: String唯一标识符(对齐 $info['identifier'])
icon: String图标路径(对齐 $info['icon'])
作者(对齐 $info['author'])
version: String版本号(对齐 $info['version'])
admin: String后台管理 URL(对齐 $info['admin'])
status: i64状态:1=启用,0=禁用(对齐 $info['status'],被 Route::execute 检查)
addon_path: PathBuf插件目录绝对路径(Rust 侧额外字段,用于后续加载文件)
Implementations§
Source§impl AddonManifest
impl AddonManifest
Sourcepub fn new(name: impl Into<String>) -> AddonManifest
pub fn new(name: impl Into<String>) -> AddonManifest
创建空清单(用于测试)
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
判断插件是否启用(对齐 PHP Route::execute 中 if (!$info['status']) 检查)
Sourcepub fn plugin_file(&self) -> PathBuf
pub fn plugin_file(&self) -> PathBuf
获取插件入口文件路径(对齐 PHP ucfirst($name) . '.php',但 Rust 侧统一使用 Plugin.php)
Sourcepub fn info_ini_file(&self) -> PathBuf
pub fn info_ini_file(&self) -> PathBuf
获取 info.ini 文件路径(对齐 PHP info.ini)
Sourcepub fn config_php_file(&self) -> PathBuf
pub fn config_php_file(&self) -> PathBuf
获取 config.php 文件路径(对齐 PHP config.php)
Sourcepub fn service_ini_file(&self) -> PathBuf
pub fn service_ini_file(&self) -> PathBuf
获取 service.ini 文件路径(对齐 PHP service.ini)
Sourcepub fn controller_dir(&self) -> PathBuf
pub fn controller_dir(&self) -> PathBuf
获取控制器目录路径(对齐 PHP {addon_path}/controller/)
Trait Implementations§
Source§impl Clone for AddonManifest
impl Clone for AddonManifest
Source§fn clone(&self) -> AddonManifest
fn clone(&self) -> AddonManifest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AddonManifest
impl Debug for AddonManifest
Source§impl<'de> Deserialize<'de> for AddonManifest
impl<'de> Deserialize<'de> for AddonManifest
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AddonManifest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AddonManifest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AddonManifest
Source§impl PartialEq for AddonManifest
impl PartialEq for AddonManifest
Source§impl Serialize for AddonManifest
impl Serialize for AddonManifest
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for AddonManifest
Auto Trait Implementations§
impl Freeze for AddonManifest
impl RefUnwindSafe for AddonManifest
impl Send for AddonManifest
impl Sync for AddonManifest
impl Unpin for AddonManifest
impl UnsafeUnpin for AddonManifest
impl UnwindSafe for AddonManifest
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.