Struct userstyles::response::Style[][src]

pub struct Style {
    pub id: i32,
    pub name: String,
    pub description: String,
    pub user: User,
    pub updated: String,
    pub weekly_install_count: i32,
    pub total_install_count: i32,
    pub rating: Option<f32>,
    pub after_screenshot_name: Option<String>,
    pub obsoleting_style_id: Option<i32>,
    pub obsoleting_style_name: Option<String>,
    pub obsolete: u8,
    pub admin_delete_reason: Option<String>,
    pub obsoletion_message: Option<String>,
    pub screenshots: Option<Vec<String>>,
    pub license: Option<String>,
    pub created: String,
    pub category: String,
    pub subcategory: Option<String>,
    pub pledgie_id: Option<i32>,
    pub additional_info: Option<String>,
    pub css: String,
    pub discussions: Vec<Discussion>,
    pub userjs_url: Option<String>,
    pub style_settings: Vec<StyleSetting>,
}

This struct is the root of the standard userstyles API response.

The request url is https://userstyles.org/api/v1/styles/{id}.

Fields

id of the style, this is part of the userstyles.org url

Name of the style

Summary of what the style does

User that created the style

Last update time

Installs per this week

Total install count

Rating of this style from 1 to 3

File name of the thumbnail

id for newer version of this style

Name of the replacing style

Indicate that style has been discontinued

Reason why style has been removed by an admin

Reason why style has been obsoleted

Screenshot fil names for this style

License the style is published under

Creation time

Category this style falls in

Subcategory or domain name

Pleadgie id, mostly unused

Additional informations about this style

The style's css with template placeholders

Comments on this style

JavaScipt file name for this style

Available settings

Methods

impl Style
[src]

Get the CSS of a style. This uses the style's default settings unless settings exists and provides an override. The elements of settings are always prioritized over the defaults.

Examples

use std::collections::HashMap;
use userstyles::response::Style;

let style = Style::default();
let mut map = HashMap::new();
map.insert(String::from("ACCENTCOLOR"), String::from("#f00ba2"));

let css = style.get_css(Some(&mut map));

Trait Implementations

impl PartialEq for Style
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Debug for Style
[src]

Formats the value using the given formatter. Read more

impl Default for Style
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for Style

impl Sync for Style