Struct jokeapi_rs::Joke[][src]

pub struct Joke {
    pub url: String,
    pub joke: String,
    pub joke_type: String,
    pub categories: String,
    pub blacklist_flags: String,
    pub safe: String,
    // some fields omitted
}
Expand description

Main joke struct

Fields

url: Stringjoke: Stringjoke_type: Stringcategories: Stringblacklist_flags: Stringsafe: String

Implementations

Initialize the Joke struct.

Fetch the Data from JokeAPI.

Specify the type of the joke (single or twopart). If not specified joke could be of any type.

Specify certain categories the joke should fit in. Available categories:

  • Programming
  • Misc
  • Dar
  • Pun
  • Spooky
  • Christmas

Flags to blacklist. Available flags:

  • nsfw
  • religious
  • political
  • racist
  • sexist
  • explicit

Enable safe mode.

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

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

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.