pub enum LobstersRequest {
    Frontpage,
    Recent,
    Comments,
    User(UserId),
    Story(StoryId),
    Login,
    Logout,
    StoryVote(StoryIdVote),
    CommentVote(CommentIdVote),
    Submit {
        id: StoryId,
        title: String,
    },
    Comment {
        id: CommentId,
        story: StoryId,
        parent: Option<CommentId>,
    },
}
Expand description

A single lobste.rs client request.

Note that one request may end up issuing multiple backend queries. To see which queries are executed by the real lobste.rs, see the lobste.rs source code.

Any request type that mentions an “acting” user is guaranteed to have the user argument to handle be Some.

Variants

Frontpage

Render the frontpage.

Recent

Comments

User(UserId)

Render a user’s profile.

Note that the id here should be treated as a username.

Story(StoryId)

Render a particular story.

Login

Log in the acting user.

Note that a user need not be logged in by a LobstersRequest::Login in order for a user-action (like LobstersRequest::Submit) to be issued for that user. The id here should be considered both a username and an id. The user with the username derived from this id should have the given id.

Logout

Log out the acting user.

StoryVote(StoryIdVote)

Have the acting user issue an up or down vote for the given story.

Note that the load generator does not guarantee that a given user will only issue a single vote for a given story, nor that they will issue an equivalent number of upvotes and downvotes for a given story.

CommentVote(CommentIdVote)

Have the acting user issue an up or down vote for the given comment.

Note that the load generator does not guarantee that a given user will only issue a single vote for a given comment, nor that they will issue an equivalent number of upvotes and downvotes for a given comment.

Submit

Fields

id: StoryId

The new story’s id.

title: String

The story’s title.

Have the acting user submit a new story to the site.

Note that the generator dictates the ids of new stories so that it can more easily keep track of which stories exist, and thus which stories can be voted for or commented on.

Comment

Fields

id: CommentId

The new comment’s id.

story: StoryId

The story the comment is for.

parent: Option<CommentId>

The id of the comment’s parent comment, if any.

Have the acting user submit a new comment to the given story.

Note that the generator dictates the ids of new comments so that it can more easily keep track of which comments exist for the purposes of generating comment votes and deeper threads.

Implementations

Enumerate all possible request types in a deterministic order.

Give a textual representation of the given LobstersRequest discriminant.

Useful for printing the keys of the maps of histograms returned by run.

Produce a textual representation of this request.

These are on the form:

METHOD /path [params] <user>

Where:

  • METHOD is GET or POST.
  • /path is the approximate lobste.rs URL endpoint for the request.
  • [params] are any additional params to the request such as id to assign or associate a new resource with with.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.