Structs§
- Author
- Award
- Awards
- Comment
- Error
Template - Flags
- Flair
- Flair
Part - Gallery
Media - Info
Template - Media
- NSFW
Landing Template - Template for NSFW landing page. The landing page is displayed when a page’s content is wholly NSFW, but a user has not enabled the option to view NSFW posts.
- Params
- Poll
- Poll
Option - Post
- Preferences
- Subreddit
- Theme
Assets - User
Enums§
- Resource
Type - Identifies whether or not the page is a subreddit, a user page, or a post. This is used by the NSFW landing template to determine the mesage to convey to the user.
Functions§
- catch_
random - deflate_
compress - deflate_
decompress - disable_
indexing - Returns true if the config/env variable
REDLIB_ROBOTS_DISABLE_INDEXING
carries the valueon
. - enable_
rss - Returns true if the config/env variable REDLIB_ENABLE_RSS is set to “on”. If this variable is set as such, the instance will enable RSS feeds. Otherwise, the instance will not provide RSS feeds.
- error
- Renders a generic error landing page.
- filter_
posts - Filters a
Vec<Post>
by the givenHashSet
of filters (each filter being a subreddit name or a user name). If aPost
’s subreddit or author is found in the filters, it is removed. - format_
num - format_
url - get_
filters - Gets a
HashSet
of filters from the cookie in the givenRequest
. - get_
post_ url - info
- Renders a generic info landing page.
- nsfw_
landing - Renders the landing page for NSFW content when the user has not enabled “show NSFW posts” in settings.
- param
- parse_
post - Creates a
Post
from a provided JSON. - redirect
- render_
bullet_ lists - rewrite_
emotes - rewrite_
urls - setting
- setting_
or_ default - sfw_
only - Returns true if the config/env variable
REDLIB_SFW_ONLY
carries the valueon
. - should_
be_ nsfw_ gated - template
- time
- url_
path_ basename - val