pub struct TestConfig {
pub message_count: Option<u32>,
pub max_messages_per_second: Option<u32>,
pub seed: Option<u32>,
pub message_size: Option<u32>,
pub send_batch_on_register: Option<bool>,
pub dummy_fields: Option<DummyFields>,
}
Expand description
The configuration for a fake producer used in tests.
Fields§
§message_count: Option<u32>
The number of messages the fake producer should send.
max_messages_per_second: Option<u32>
The maximum number of messages which should be sent each second. The actual obserced speed may be lower if the producer is unable to work fast enough. If this is zero or unset, the producer will send as fast as possible.
seed: Option<u32>
The seed value for a simple multiplicative congruential pseudo-random number sequence.
message_size: Option<u32>
The size of each message in bytes. Should be greater than or equal 5 to account for the number of bytes needed to encode the random number and a null byte for the string.
send_batch_on_register: Option<bool>
Whether the producer should send a event batch when the data source is is initially registered.
dummy_fields: Option<DummyFields>
Implementations§
Source§impl TestConfig
impl TestConfig
Sourcepub fn message_count(&self) -> u32
pub fn message_count(&self) -> u32
Returns the value of message_count
, or the default value if message_count
is unset.
Sourcepub fn max_messages_per_second(&self) -> u32
pub fn max_messages_per_second(&self) -> u32
Returns the value of max_messages_per_second
, or the default value if max_messages_per_second
is unset.
Sourcepub fn message_size(&self) -> u32
pub fn message_size(&self) -> u32
Returns the value of message_size
, or the default value if message_size
is unset.
Sourcepub fn send_batch_on_register(&self) -> bool
pub fn send_batch_on_register(&self) -> bool
Returns the value of send_batch_on_register
, or the default value if send_batch_on_register
is unset.
Trait Implementations§
Source§impl Clone for TestConfig
impl Clone for TestConfig
Source§fn clone(&self) -> TestConfig
fn clone(&self) -> TestConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TestConfig
impl Debug for TestConfig
Source§impl Default for TestConfig
impl Default for TestConfig
Source§impl Message for TestConfig
impl Message for TestConfig
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
.Source§impl PartialEq for TestConfig
impl PartialEq for TestConfig
impl StructuralPartialEq for TestConfig
Auto Trait Implementations§
impl Freeze for TestConfig
impl RefUnwindSafe for TestConfig
impl Send for TestConfig
impl Sync for TestConfig
impl Unpin for TestConfig
impl UnwindSafe for TestConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)