Struct sunk::User

source ·
pub struct User {
Show 19 fields pub username: String, pub email: String, pub max_bit_rate: u64, pub scrobbling_enabled: bool, pub ldap_authenticated: bool, pub admin_role: bool, pub settings_role: bool, pub download_role: bool, pub upload_role: bool, pub playlist_role: bool, pub cover_art_role: bool, pub comment_role: bool, pub podcast_role: bool, pub stream_role: bool, pub jukebox_role: bool, pub share_role: bool, pub video_conversion_role: bool, pub avatar_last_changed: String, pub folders: Vec<u64>, /* private fields */
}
Expand description

A struct representing a Subsonic user.

Fields

username: String

A user’s name.

email: String

A user’s email address.

max_bit_rate: u64

A user may be limited to the bit rate of media they may stream. Any higher sampled media will be downsampled to their limit. A limit of 0 disables this.

scrobbling_enabled: bool

Whether the user is allowed to scrobble their songs to last.fm.

ldap_authenticated: bool

Whether the user is authenticated in LDAP.

admin_role: bool

Whether the user is an administrator.

settings_role: bool

Whether the user is allowed to manage their own settings and change their password.

download_role: bool

Whether the user is allowed to download media.

upload_role: bool

Whether the user is allowed to upload media.

playlist_role: bool

Whether the user is allowed to modify or delete playlists.

cover_art_role: bool

Whether the user is allowed to change cover art and media tags.

comment_role: bool

Whether the user is allowed to create and edit comments and ratings.

podcast_role: bool

Whether the user is allowed to administrate podcasts.

stream_role: bool

Whether the user is allowed to play media.

jukebox_role: bool

Whether the user is allowed to control the jukebox.

share_role: bool

Whether the user is allowed to share content.

video_conversion_role: bool

Whether the user is allowed to start video conversions.

avatar_last_changed: String

The date the user’s avatar was last changed (as an ISO8601 timestamp).

folders: Vec<u64>

The list of media folders the user has access to.

Implementations

Fetches a single user’s information from the server.

Lists all users on the server.

Errors

Attempting to use this method as a non-administrative user (when creating the Client) will result in a NotAuthorized error.

Changes the user’s password.

Errors

A user may only change their own password, and only if they have the settings_role permission, unless they are an administrator.

Returns the user’s avatar image as a collection of bytes.

The method makes no guarantee as to the encoding of the image, but does guarantee that it is a valid image file.

Creates a new local user to be pushed to the server.

See the UserBuilder struct for more details.

Removes the user from the Subsonic server.

Pushes any changes made to the user to the server.

Examples
extern crate sunk;
use sunk::{Client, User};

let client = Client::new("http://demo.subsonic.org", "guest3", "guest")?;
let mut user = User::get(&client, "guest")?;

// Update email
user.email = "user@example.com".to_string();
// Disable commenting
user.comment_role = false;
// Update on server
user.update(&client)?;

Trait Implementations

Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.