pub struct MetaData {
pub task: Value,
pub login_info: Value,
pub module_config: Value,
pub trait_meta: Value,
}Fields§
§task: ValueTask metadata. Provenance: Task definition → ParserModel/ErrorModel processing →
TaskFactory merge → Module.generate() → Request.meta
Stored by serializing the task config into a Value via add_task_config().
login_info: ValueLogin information. Provenance: the LoginInfo.extra field → user authentication/authorization
system → Module.generate() → Request.meta
Extracted from LoginInfo’s extra field and serialized via add_login_info().
module_config: ValueModule configuration. Provenance: database (account/platform/middleware relation tables) →
ModuleConfig instance → module initialization → Module.generate() → Request.meta
Includes: account table config, platform table config, the module’s own config,
rel_module_account config, rel_module_platform config, middleware config, and so on.
Stored by serializing the whole ModuleConfig struct via add_module_config().
trait_meta: ValueTrait metadata. Provenance: individual trait implementations → trait type definitions →
business code calls → add_trait_config() → Request.meta
Stores trait-level custom configuration and extension data via add_trait_config().
Implementations§
Source§impl MetaData
impl MetaData
pub fn add(self, key: impl AsRef<str>, value: Value, source: MetaSource) -> Self
pub fn add_task_config<T>(self, task_meta: T) -> Selfwhere
T: Serialize,
pub fn add_login_info(self, login_info: &LoginInfo) -> Self
pub fn add_module_config(self, module_config: &ModuleConfig) -> Self
pub fn add_trait_config<T>(self, key: impl AsRef<str>, value: T) -> Selfwhere
T: Serialize,
pub fn get_trait_config<T>(&self, key: &str) -> Option<T>where
T: for<'de> Deserialize<'de>,
pub fn get_login_config<T>(&self, key: &str) -> Option<T>where
T: for<'de> Deserialize<'de>,
pub fn get_module_config<T>(&self, key: &str) -> Option<T>where
T: for<'de> Deserialize<'de>,
pub fn get_task_config<T>(&self, key: &str) -> Option<T>where
T: for<'de> Deserialize<'de>,
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MetaData
impl<'de> Deserialize<'de> for MetaData
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>,
Auto Trait Implementations§
impl Freeze for MetaData
impl RefUnwindSafe for MetaData
impl Send for MetaData
impl Sync for MetaData
impl Unpin for MetaData
impl UnsafeUnpin for MetaData
impl UnwindSafe for MetaData
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
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<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>
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>
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