Rating

Enum Rating 

Source
pub enum Rating {
    None,
    One,
    Two,
    Three,
    Four,
    Five,
}
Expand description

The rating of a track (one to five stars)

Variants§

§

None

No rating

§

One

One-star rating

§

Two

Two-star rating

§

Three

Three-star rating

§

Four

Four-star rating

§

Five

Five-star rating

Implementations§

Source§

impl Rating

Source

pub fn from_stars(stars: Option<u8>) -> Self

Create a Rating instance.

All invalid values are mapped to Rating::None

Source

pub fn stars(&self) -> Option<u8>

Get the count of stars of this rating

Trait Implementations§

Source§

impl From<Rating> for i32

Source§

fn from(rating: Rating) -> i32

Converts to this type from the input type.
Source§

impl From<i32> for Rating

Source§

fn from(long: i32) -> Rating

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Rating

§

impl RefUnwindSafe for Rating

§

impl Send for Rating

§

impl Sync for Rating

§

impl Unpin for Rating

§

impl UnwindSafe for Rating

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.