Enum quilkin::config::ConfigType [−][src]
Expand description
The configuration of a Filter
from either a
static or dynamic source.
Variants
Static(&'a Value)
Static configuration from YAML.
Dynamic(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>,
[src]
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>,
[src]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.
Auto Trait Implementations
impl<'a> RefUnwindSafe for ConfigType<'a>
impl<'a> Send for ConfigType<'a>
impl<'a> Sync for ConfigType<'a>
impl<'a> Unpin for ConfigType<'a>
impl<'a> UnwindSafe for ConfigType<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. 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