pub struct Collection {
pub name: String,
pub cover_art: Option<CoverArt>,
pub collectables: Vec<Collectable>,
/* private fields */
}Fields§
§name: String§cover_art: Option<CoverArt>§collectables: Vec<Collectable>Implementations§
Source§impl Collection
impl Collection
pub fn db_find_by_name(
name: impl AsRef<str>,
) -> Result<Option<Self>, DatabaseError>where
Self: 'static,
Trait Implementations§
Source§impl Clone for Collection
impl Clone for Collection
Source§fn clone(&self) -> Collection
fn clone(&self) -> Collection
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 Createable for Collection
impl Createable for Collection
type CreateArgs = CollectionCreateArgs
Source§fn tx_create(
cas_tx: &mut CompareAndSwapTransaction,
args: Self::CreateArgs,
) -> Result<Self::Id, DatabaseError>
fn tx_create( cas_tx: &mut CompareAndSwapTransaction, args: Self::CreateArgs, ) -> Result<Self::Id, DatabaseError>
Creates a new
Self in the database using Self::CreateArgsSource§impl DatabaseEntry for Collection
impl DatabaseEntry for Collection
Source§const VERSION_NUMBER: u32 = 1
const VERSION_NUMBER: u32 = 1
The current version number of the struct, used for updating
type Id = CollectionId
fn tree(db: &Db) -> Tree
fn id(&self) -> Self::Id
Source§fn db_check(id: Self::Id) -> Result<bool>
fn db_check(id: Self::Id) -> Result<bool>
Checks if an item exists in the database as lightly as possible Read more
fn db_check_version(id: Self::Id) -> Result<Option<u32>, DatabaseError>
Source§fn db_create(args: <Self as Createable>::CreateArgs) -> Result<Self>where
Self: Createable,
fn db_create(args: <Self as Createable>::CreateArgs) -> Result<Self>where
Self: Createable,
Creates a new
Self in the database using Self::CreateArgsSource§fn db_get_batch<I, A>(ids: I) -> Result<Vec<Self>>
fn db_get_batch<I, A>(ids: I) -> Result<Vec<Self>>
fn pre_upsert( &mut self, _cas_tx: &CompareAndSwapTransaction, ) -> Result<(), DatabaseError>
fn db_upsert(&self) -> Result<()>
Source§impl Debug for Collection
impl Debug for Collection
Source§impl<'de> Deserialize<'de> for Collection
impl<'de> Deserialize<'de> for Collection
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Collection
impl PartialEq for Collection
Source§impl Serialize for Collection
impl Serialize for Collection
impl StructuralPartialEq for Collection
Auto Trait Implementations§
impl Freeze for Collection
impl RefUnwindSafe for Collection
impl Send for Collection
impl Sync for Collection
impl Unpin for Collection
impl UnsafeUnpin for Collection
impl UnwindSafe for Collection
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