Add doc comments to Payload new methods
The method names are a bit confusing (because the method has an Action
verb 'create' in the name), so try and clarify with comments.
@@ -112,6 +112,8 @@ struct Payload {
}
impl Payload {
+ /// Creates a Payload initialized with Action::CREATE and a randomly
+ /// generated name.
pub fn new_as_create_with_random_name(rnd: &mut Hc128Rng) -> Self {
let length = rnd.gen_range(5, 20);
@@ -123,6 +125,8 @@ impl Payload {
)
}
+ /// Creates a Payload initialized with Action::CREATE and the specified
+ /// name.
pub fn new_as_create(name: &str) -> Self {
Payload {
name: String::from(name),
