Enum trawler::LobstersRequest
[−]
[src]
pub enum LobstersRequest { Frontpage, Recent, User(u32), Story([u8; 6]), Login(u32), Logout(u32), StoryVote(u32, [u8; 6], Vote), CommentVote(u32, [u8; 6], Vote), Submit { id: [u8; 6], user: u32, title: String, }, Comment { id: [u8; 6], user: u32, story: [u8; 6], parent: Option<[u8; 6]>, }, }
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.
Variants
Frontpage
Render the frontpage.
Recent
Render recently submitted stories.
User(u32)
Render a user's profile.
Note that the id here should be treated as a username.
Story([u8; 6])
Render a particular story.
Login(u32)
Log in the given user.
Note that a user need not be logged in by a LobstersRequest
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(u32)
Log out the given user.
Note that a user need not be logged in by a LobstersRequest
in order for a user-action
(like LobstersRequest::Submit
) to be issued for that user.
StoryVote(u32, [u8; 6], Vote)
Have the given 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(u32, [u8; 6], Vote)
Have the given 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 given 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.
Fields of Submit
id: [u8; 6] | The new story's id. |
user: u32 | The story's submitter. |
title: String | The story's title. |
Comment
Have the given 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.
Fields of Comment
id: [u8; 6] | The new comment's id. |
user: u32 | The comment's author. |
story: [u8; 6] | The story the comment is for. |
parent: Option<[u8; 6]> | The id of the comment's parent comment, if any. |
Trait Implementations
impl Debug for LobstersRequest
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for LobstersRequest
[src]
fn clone(&self) -> LobstersRequest
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for LobstersRequest
[src]
impl PartialEq for LobstersRequest
[src]
fn eq(&self, __arg_0: &LobstersRequest) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &LobstersRequest) -> bool
[src]
This method tests for !=
.
impl Ord for LobstersRequest
[src]
fn cmp(&self, __arg_0: &LobstersRequest) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl PartialOrd for LobstersRequest
[src]
fn partial_cmp(&self, __arg_0: &LobstersRequest) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &LobstersRequest) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &LobstersRequest) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &LobstersRequest) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &LobstersRequest) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more