Enum quilkin::config::ConfigType[][src]

pub enum ConfigType<'a> {
    Static(&'a Value),
    Dynamic(Any),
}
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

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Wrap the input message T in a tonic::Request

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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