Trait arbitrary::Unstructured
[−]
[src]
pub trait Unstructured { type Error; fn fill_buffer(&mut self, buffer: &mut [u8]) -> Result<(), Self::Error>; fn container_size(&mut self) -> Result<usize, Self::Error> { ... } }
Unstructured data from which structured Arbitrary
data shall be generated.
This could be a random number generator, a static ring buffer of bytes or some such.
Associated Types
type Error
Required Methods
fn fill_buffer(&mut self, buffer: &mut [u8]) -> Result<(), Self::Error>
Fill a buffer
with bytes, forming the unstructured data from which Arbitrary
structured
data shall be generated.
This operation is fallible to allow implementations based on e.g. I/O.
Provided Methods
fn container_size(&mut self) -> Result<usize, Self::Error>
Generate a size for container.
e.g. number of elements in a vector
Implementors
impl<'a> Unstructured for RingBuffer<'a> type Error = ();