#[non_exhaustive]pub struct MockProducerOptions<K, V> { /* private fields */ }Expand description
Parameters for MockProducer::with_options.
This struct has no Java counterpart. It exists because a method taking
more than three parameters beyond the overload group’s intersection takes a
single options struct instead: Java’s widest
MockProducer(Cluster, boolean, Partitioner, Serializer, Serializer)
constructor (MockProducer#MockProducer) differs from the group’s parameter-name
intersection — which is EMPTY, since the no-arg MockProducer is in the group — by
five parameters, so this struct becomes the method’s only
parameter, carrying every Java parameter.
It deliberately has no Default. auto_complete is what both
parameter-taking Java constructors (MockProducer#MockProducer(Cluster,boolean,Partitioner,Serializer,Serializer), MockProducer#MockProducer(boolean,Partitioner,Serializer,Serializer)) take from their caller, so
it has no Java-derived default; the no-arg MockProducer#MockProducer(), which does default it to
false, is translated as Default for MockProducer instead.
Construct it with MockProducerOptionsBuilder::new and set it:
MockProducerOptionsBuilder::build returns an error if auto_complete was
not set.