pub trait FreightRegistrar {
// Required method
fn register_freight(&mut self, freight: Box<dyn Freight>);
}Expand description
Trait to be implemented on structs, which are used to register or store the imported plugins
This trait is only needed for internal usage and as a reference
for the plugins, so that they can define a function that takes a
FreightRegistrar implementor as an argument, so that when
the plugin is imported the function is called on it and
some unexportable things such as structures could be provided,
which in this particular case is a Freight implementor
structure
Required Methods§
Sourcefn register_freight(&mut self, freight: Box<dyn Freight>)
fn register_freight(&mut self, freight: Box<dyn Freight>)
Function that gets a Freight implementor passed as an
argument and is used to use it wherever it is needed in the
FreightRegistrar implementor