[][src]Enum trawler::LobstersRequest

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>,
    },
}

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.

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.

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

impl LobstersRequest[src]

pub fn all() -> IntoIter<Discriminant<Self>>[src]

Enumerate all possible request types in a deterministic order.

pub fn variant_name(v: &Discriminant<Self>) -> &'static str[src]

Give a textual representation of the given LobstersRequest discriminant.

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

pub fn describe(&self) -> String[src]

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

impl Clone for LobstersRequest[src]

impl Debug for LobstersRequest[src]

impl Eq for LobstersRequest[src]

impl Hash for LobstersRequest[src]

impl Ord for LobstersRequest[src]

impl PartialEq<LobstersRequest> for LobstersRequest[src]

impl PartialOrd<LobstersRequest> for LobstersRequest[src]

impl StructuralEq for LobstersRequest[src]

impl StructuralPartialEq for LobstersRequest[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,