http_type/attribute/enum.rs
1use crate::*;
2
3/// Represents the key for an attribute.
4///
5/// Attributes can be either external, defined by a user-provided string,
6/// or internal, representing framework-specific functionality.
7#[derive(Clone, CustomDebug, Deserialize, DisplayDebug, Eq, Hash, PartialEq, Serialize)]
8pub enum Attribute {
9 /// An external attribute identified by a string.
10 External(String),
11 /// An internal attribute with a predefined key.
12 Internal(InternalAttribute),
13}
14
15/// Defines keys for internal attributes used by the framework.
16///
17/// These keys correspond to specific, built-in functionalities.
18#[derive(Clone, Copy, CustomDebug, Deserialize, DisplayDebug, Eq, Hash, PartialEq, Serialize)]
19pub enum InternalAttribute {
20 /// The attribute key for task panic handling with detailed error information.
21 TaskPanicData,
22 /// The attribute key for request error handling.
23 RequestErrorData,
24}