pub struct LibrarySong<T: Serialize + DeserializeOwned + Clone> {
pub bliss_song: Song,
pub extra_info: T,
}Expand description
Struct holding both a Bliss song, as well as any extra info that a user would want to store in the database related to that song.
The only constraint is that extra_info must be serializable, so,
something like
#[derive(Serialize)]
struct ExtraInfo {
ignore: bool,
unique_id: i64,
}
let extra_info = ExtraInfo { ignore: true, unique_id = 123 };
let song = LibrarySong { bliss_song: song, extra_info };is totally possible.
Fields§
§bliss_song: SongActual bliss song, containing the song’s metadata, as well as the bliss analysis.
extra_info: TUser-controlled information regarding that specific song.
Trait Implementations§
Source§impl<T: Serialize + DeserializeOwned + Clone> AsRef<Song> for LibrarySong<T>
impl<T: Serialize + DeserializeOwned + Clone> AsRef<Song> for LibrarySong<T>
Source§impl<T: Clone + Serialize + DeserializeOwned + Clone> Clone for LibrarySong<T>
impl<T: Clone + Serialize + DeserializeOwned + Clone> Clone for LibrarySong<T>
Source§fn clone(&self) -> LibrarySong<T>
fn clone(&self) -> LibrarySong<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + Serialize + DeserializeOwned + Clone> Debug for LibrarySong<T>
impl<T: Debug + Serialize + DeserializeOwned + Clone> Debug for LibrarySong<T>
Source§impl<T: PartialEq + Serialize + DeserializeOwned + Clone> PartialEq for LibrarySong<T>
impl<T: PartialEq + Serialize + DeserializeOwned + Clone> PartialEq for LibrarySong<T>
impl<T: Serialize + DeserializeOwned + Clone> StructuralPartialEq for LibrarySong<T>
Auto Trait Implementations§
impl<T> Freeze for LibrarySong<T>where
T: Freeze,
impl<T> RefUnwindSafe for LibrarySong<T>where
T: RefUnwindSafe,
impl<T> Send for LibrarySong<T>where
T: Send,
impl<T> Sync for LibrarySong<T>where
T: Sync,
impl<T> Unpin for LibrarySong<T>where
T: Unpin,
impl<T> UnwindSafe for LibrarySong<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more