Trait SampleString

trait SampleString

Sample or extend a String

Helper methods to extend a String or sample a new String.

Required Methods

fn append_string<R: Rng + ?Sized>(self: &Self, rng: &mut R, string: &mut String, len: usize)

Append len random chars to string

Note: implementations may leave string with excess capacity. If this is undesirable, consider calling String::shrink_to_fit after this method.

Provided Methods

fn sample_string<R: Rng + ?Sized>(self: &Self, rng: &mut R, len: usize) -> String

Generate a String of len random chars

Note: implementations may leave the string with excess capacity. If this is undesirable, consider calling String::shrink_to_fit after this method.

Implementors