pub struct Config {
pub ignore_unknown_fields: bool,
pub allowed_proto_any_urls: Vec<Pattern>,
pub diagnostic_level_overrides: HashMap<Classification, (Level, Level)>,
pub uri_overrides: Vec<(Pattern, Option<String>)>,
pub uri_resolver: Option<UriResolver>,
pub max_uri_resolution_depth: Option<usize>,
}Expand description
Configuration structure.
Fields
ignore_unknown_fields: boolWhen set, do not generate warnings for unknown protobuf fields that are set to their protobuf-defined default value.
allowed_proto_any_urls: Vec<Pattern>Protobuf message URLs that are explicitly allowed for use in “any” messages, i.e. that the caller warrants the existence of in the consumer that the plan is validated for.
diagnostic_level_overrides: HashMap<Classification, (Level, Level)>Allows the level of diagnostic messages to be overridden based on their classification/code. The logic for this is as follows:
- if an entry exists for the classication of the incoming diagnostic, override its error level to at most the second argument, and then to at least the first argument. Otherwise,
- if an entry exists for the group of said classification, use its level limits instead. Otherwise,
- if an entry exists for Unclassified (code 0), use its level limits instead. Otherwise, do not adjust the level.
Note that setting an entry to (Info, Error) leaves the diagnostic level unchanged.
uri_overrides: Vec<(Pattern, Option<String>)>Allows URIs from the plan to be remapped (Some(mapping)) or ignored (None). All resolution can effectively be disabled by just adding a rule that maps * to None. Furthermore, in the absence of a custom yaml_uri_resolver function, this can be used to remap URIs to pre-downloaded files.
uri_resolver: Option<UriResolver>Optional callback function for resolving URIs. If specified, all
URIs (after processing yaml_uri_overrides) are resolved using this
function. The function takes the URI as its argument, and should either
return the download contents as a Vec
max_uri_resolution_depth: Option<usize>Optional URI resolution depth. If specified, dependencies are only resolved this many levels deep. Setting this to zero effectively disables extension URI resolution altogether.
Implementations
sourceimpl Config
impl Config
sourcepub fn ignore_unknown_fields(&mut self)
pub fn ignore_unknown_fields(&mut self)
Instructs the validator to ignore protobuf fields that it doesn’t know about yet (i.e., that have been added to the Substrait protobuf descriptions, but haven’t yet been implemented in the validator) if the fields are set to their default value. If this option isn’t set, or if an unknown field is not set to its default value, a warning is emitted.
sourcepub fn allow_proto_any_url(&mut self, pattern: Pattern)
pub fn allow_proto_any_url(&mut self, pattern: Pattern)
Explicitly allows a protobuf message type to be used in advanced extensions, despite the fact that the validator can’t validate it. If an advanced extension is encountered that isn’t explicitly allowed, a warning is emitted.
sourcepub fn override_diagnostic_level(
&mut self,
class: Classification,
minimum: Level,
maximum: Level
)
pub fn override_diagnostic_level(
&mut self,
class: Classification,
minimum: Level,
maximum: Level
)
Sets a minimum and/or maximum error level for the given class of diagnostic messages. Any previous settings for this class are overridden.
sourcepub fn override_uri<S: Into<String>>(
&mut self,
pattern: Pattern,
resolve_as: Option<S>
)
pub fn override_uri<S: Into<String>>(
&mut self,
pattern: Pattern,
resolve_as: Option<S>
)
Overrides the resolution behavior for (YAML) URIs matching the given pattern. If resolve_as is None, the URI file will not be resolved; if it is Some(s), it will be resolved as if the URI in the plan had been s.
sourcepub fn add_uri_resolver<F, D, E>(&mut self, resolver: F)where
F: Fn(&str) -> Result<D, E> + Send + 'static,
D: AsRef<[u8]> + 'static,
E: Error + 'static,
pub fn add_uri_resolver<F, D, E>(&mut self, resolver: F)where
F: Fn(&str) -> Result<D, E> + Send + 'static,
D: AsRef<[u8]> + 'static,
E: Error + 'static,
Registers a URI resolution function with this configuration. If the given function fails, any previously registered function will be used as a fallback.
sourcepub fn set_max_uri_resolution_depth(&mut self, depth: Option<usize>)
pub fn set_max_uri_resolution_depth(&mut self, depth: Option<usize>)
Sets the maximum recursion depth for URI resolution, in the presence of transitive dependencies. Setting this to None disables the limit, setting this to zero disables URI resolution entirely.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Config
impl Send for Config
impl !Sync for Config
impl Unpin for Config
impl !UnwindSafe for Config
Blanket Implementations
impl<T> AnyExt for Twhere
T: Any + ?Sized,
impl<T> AnyExt for Twhere
T: Any + ?Sized,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referencefn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referencefn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerfn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointerfn downcast_box<T>(
this: Box<Self, Global>
) -> Result<Box<T, Global>, Box<Self, Global>>where
T: Any,
fn downcast_box<T>(
this: Box<Self, Global>
) -> Result<Box<T, Global>, Box<Self, Global>>where
T: Any,
T behind Box pointerfn downcast_move<T>(this: Self) -> Option<T>where
T: Any,
fn downcast_move<T>(this: Self) -> Option<T>where
T: Any,
Self to T,
useful only in generic context as a workaround for specialization Read moresourceimpl<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, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X, Global>) -> Box<T, Global>ⓘNotable traits for Box<W, Global>impl<W> Write for Box<W, Global>where
W: Write + ?Sized,impl<R> Read for Box<R, Global>where
R: Read + ?Sized,impl<I, A> Iterator for Box<I, A>where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A>where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
W: Write + ?Sized,impl<R> Read for Box<R, Global>where
R: Read + ?Sized,impl<I, A> Iterator for Box<I, A>where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A>where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;