pub trait SampleString {
// Required method
fn append_string<R>(&self, rng: &mut R, string: &mut String, len: usize)
where R: Rng + ?Sized;
// Provided method
fn sample_string<R>(&self, rng: &mut R, len: usize) -> String
where R: Rng + ?Sized { ... }
}
Expand description
Required Methods§
Sourcefn append_string<R>(&self, rng: &mut R, string: &mut String, len: usize)
fn append_string<R>(&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§
Sourcefn sample_string<R>(&self, rng: &mut R, len: usize) -> String
fn sample_string<R>(&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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.