Enum quilkin::config::ConfigType [−][src]
Expand description
The configuration of a Filter
from either a
static or dynamic source.
Variants
Static(Value)
Tuple Fields
0: Value
Static configuration from YAML.
Dynamic(Any)
Tuple Fields
0: Any
Dynamic configuration from Protobuf.
Implementations
pub fn deserialize<Static, Dynamic>(
self,
filter_name: &str
) -> Result<(Value, Static), Error> where
Dynamic: Message + Default,
Static: Serialize + for<'de> Deserialize<'de> + TryFrom<Dynamic, Error = ConvertProtoConfigError>,
pub fn deserialize<Static, Dynamic>(
self,
filter_name: &str
) -> Result<(Value, Static), Error> where
Dynamic: Message + Default,
Static: Serialize + for<'de> Deserialize<'de> + TryFrom<Dynamic, Error = ConvertProtoConfigError>,
Deserializes takes two type arguments Static
and Dynamic
representing
the types of a static and dynamic configuration respectively.
If the configuration input is a ConfigType::Static, then it is directly
deserialized into the returned Static
instance.
Otherwise if the input is a ConfigType::Dynamic then the contained Protobuf
data is decoded into a type Dynamic
instance, after which the decoded
value is converted into the returned Static
instance.
As a result TryFrom must be implemented from the Dynamic
to the Static
type.
It returns both the deserialized, as well as, a JSON representation of the provided config. It returns an error if any of the serialization or deserialization steps fail.
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
The name of the generated JSON Schema. Read more
Generates a JSON Schema for this type. Read more
fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the $ref
keyword. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ConfigType
impl Send for ConfigType
impl Sync for ConfigType
impl Unpin for ConfigType
impl UnwindSafe for ConfigType
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more