Enum trawler::LobstersRequest[][src]

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

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.

Show fields

Fields of Submit

id: StoryId

The new story’s id.

title: String

The story’s title.

Comment

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.

Show fields

Fields of Comment

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.

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 !=.

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

Converts self into T using Into<T>. Read more

Converts self into a target type. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Performs the conversion.

Performs the conversion.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

Provides immutable access to the reference for inspection.

Calls tap_ref in debug builds, and does nothing in release builds.

Provides mutable access to the reference for modification.

Calls tap_ref_mut in debug builds, and does nothing in release builds.

Provides immutable access to the borrow for inspection. Read more

Calls tap_borrow in debug builds, and does nothing in release builds.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Attempts to convert self into T using TryInto<T>. Read more

Attempts to convert self into a target type. 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.