pub struct InspectorBuilder { /* private fields */ }
Expand description
Configures and builds an instance of Inspector
.
§Fields
§sources
List of paths to directories with MAVLink
XML definitions. Use InspectorBuilder::set_sources
to set sources
or InspectorBuilder::add_source
to push singe source location.
§include
/ exclude
Define:
include
:InspectorBuilder::set_include
exclude
:InspectorBuilder::set_exclude
These fields specify which dialects will be added. Exclusion/inclusion rules will be applied
only to the first level of dialects. Which means that if dialect X
has dialect Y
as a
dependency, then Y
will be loaded and parsed even if explicitly excluded.
If both include
and exclude
are set, then includes will have precedence over exclusion list. Which means that dialects will
be excluded within the list of explicitly specified dialects.
Implementations§
Source§impl InspectorBuilder
impl InspectorBuilder
Sourcepub fn build(&self) -> Result<Inspector>
pub fn build(&self) -> Result<Inspector>
Load an instance of Inspector
.
Loads a collection of DialectXmlDefinition
in the process.
§Errors
- Returns variants of
Error
if XML definitions discovery fails. - In the case of dialect naming collision returns
XmlInspectionError::NamingCollision
.
Sourcepub fn set_sources<T>(&mut self, sources: &[T]) -> &mut Self
pub fn set_sources<T>(&mut self, sources: &[T]) -> &mut Self
Sets source paths.
Each sources
item is a path to a directory containing MAVLink
XML definitions.
Sourcepub fn add_source<T>(&mut self, source: T) -> &mut Self
pub fn add_source<T>(&mut self, source: T) -> &mut Self
Adds source path.
Adds path to a directory containing MAVLink
XML definitions.
Sourcepub fn set_include<T: ?Sized + ToString>(
&mut self,
dialect_names: &[&T],
) -> &mut Self
pub fn set_include<T: ?Sized + ToString>( &mut self, dialect_names: &[&T], ) -> &mut Self
Sets the list of dialect names to include.
Names will be transformed to Dialect::canonical_name
upon matching.
Sourcepub fn set_exclude<T: ?Sized + ToString>(
&mut self,
dialect_names: &[&T],
) -> &mut Self
pub fn set_exclude<T: ?Sized + ToString>( &mut self, dialect_names: &[&T], ) -> &mut Self
Sets the list of dialect names to exclude.
Names will be transformed to Dialect::canonical_name
upon matching.
Trait Implementations§
Source§impl Clone for InspectorBuilder
impl Clone for InspectorBuilder
Source§fn clone(&self) -> InspectorBuilder
fn clone(&self) -> InspectorBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more