pub struct SchemaProvider { /* private fields */ }Expand description
Schema 提供者
管理配置 Schema,提供配置项元数据查询和缓存
Implementations§
Source§impl SchemaProvider
impl SchemaProvider
Sourcepub fn get_plugin_schema(&self, prefix: &str) -> Option<PluginSchema>
pub fn get_plugin_schema(&self, prefix: &str) -> Option<PluginSchema>
获取插件 Schema
使用缓存提高性能,返回克隆以避免锁竞争
Sourcepub fn get_property_schema(
&self,
prefix: &str,
property: &str,
) -> Option<PropertySchema>
pub fn get_property_schema( &self, prefix: &str, property: &str, ) -> Option<PropertySchema>
获取属性 Schema
查询指定插件的指定属性
Sourcepub fn get_all_prefixes(&self) -> Vec<String>
pub fn get_all_prefixes(&self) -> Vec<String>
获取所有配置前缀
返回所有已注册插件的配置前缀列表
Source§impl SchemaProvider
impl SchemaProvider
Sourcepub fn from_schema(schema: ConfigSchema) -> Self
pub fn from_schema(schema: ConfigSchema) -> Self
从给定的 ConfigSchema 创建 SchemaProvider(用于测试)
这个方法主要用于属性测试,允许使用自定义的 Schema 创建提供者
Trait Implementations§
Source§impl Clone for SchemaProvider
impl Clone for SchemaProvider
Source§fn clone(&self) -> SchemaProvider
fn clone(&self) -> SchemaProvider
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SchemaProvider
impl !RefUnwindSafe for SchemaProvider
impl Send for SchemaProvider
impl Sync for SchemaProvider
impl Unpin for SchemaProvider
impl UnwindSafe for SchemaProvider
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more