Enum quilkin::config::ConfigType
source · [−]Expand description
The configuration of a Filter
from either a
static or dynamic source.
Variants
Static(Value)
Static configuration from YAML.
Dynamic(Any)
Dynamic configuration from Protobuf.
Implementations
sourceimpl ConfigType
impl ConfigType
sourcepub fn deserialize<TextConfiguration, BinaryConfiguration>(
self,
filter_name: &str
) -> Result<(Value, TextConfiguration), Error>where
BinaryConfiguration: Message + Default,
TextConfiguration: Serialize + for<'de> Deserialize<'de> + TryFrom<BinaryConfiguration>,
Error: From<<BinaryConfiguration as TryInto<TextConfiguration>>::Error>,
pub fn deserialize<TextConfiguration, BinaryConfiguration>(
self,
filter_name: &str
) -> Result<(Value, TextConfiguration), Error>where
BinaryConfiguration: Message + Default,
TextConfiguration: Serialize + for<'de> Deserialize<'de> + TryFrom<BinaryConfiguration>,
Error: From<<BinaryConfiguration as TryInto<TextConfiguration>>::Error>,
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
sourceimpl Clone for ConfigType
impl Clone for ConfigType
sourcefn clone(&self) -> ConfigType
fn clone(&self) -> ConfigType
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for ConfigType
impl Debug for ConfigType
sourceimpl<'de> Deserialize<'de> for ConfigType
impl<'de> Deserialize<'de> for ConfigType
sourcefn deserialize<D>(de: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(de: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
sourceimpl From<Value> for ConfigType
impl From<Value> for ConfigType
sourceimpl JsonSchema for ConfigType
impl JsonSchema for ConfigType
sourcefn schema_name() -> String
fn schema_name() -> String
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moresourceimpl PartialEq<ConfigType> for ConfigType
impl PartialEq<ConfigType> for ConfigType
sourcefn eq(&self, other: &ConfigType) -> bool
fn eq(&self, other: &ConfigType) -> bool
sourceimpl Serialize for ConfigType
impl Serialize for ConfigType
impl StructuralPartialEq for ConfigType
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request