pub enum FeatureValue {
Float(f32),
Int(u32),
}Expand description
Represents the value of a feature. They can be either floats or values.
The value can be directly specified (e.g. 0, 100, 0.5, Mode::Major etc.), as this type
implements From for various type.
Note: You must use the right values yourself for each option. They can either take
integers from 0 - 100, floats from 0 - 1, or special types (like Mode)
In order to know what values each feature takes, you can use this page.
§Example
let recommendations = recommendations(Seed::artists(&["59XQUEHhy5830QsAsmhe2M"]))
.features(&[
Feature::min(FeatureKind::Energy, 0.5),
Feature::max(FeatureKind::Popularity, 64),
Feature::target(FeatureKind::Mode, Mode::Major),
])
.get(spotify)
.await?;Variants§
Trait Implementations§
Source§impl Clone for FeatureValue
impl Clone for FeatureValue
Source§fn clone(&self) -> FeatureValue
fn clone(&self) -> FeatureValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FeatureValue
impl Debug for FeatureValue
Source§impl From<Mode> for FeatureValue
impl From<Mode> for FeatureValue
Source§impl From<f32> for FeatureValue
impl From<f32> for FeatureValue
Source§impl From<u32> for FeatureValue
impl From<u32> for FeatureValue
Source§impl Serialize for FeatureValue
impl Serialize for FeatureValue
impl Copy for FeatureValue
Auto Trait Implementations§
impl Freeze for FeatureValue
impl RefUnwindSafe for FeatureValue
impl Send for FeatureValue
impl Sync for FeatureValue
impl Unpin for FeatureValue
impl UnsafeUnpin for FeatureValue
impl UnwindSafe for FeatureValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more