shared::domain::asset

Enum Asset

Source
pub enum Asset {
    Jig(JigResponse),
    Playlist(PlaylistResponse),
    Resource(ResourceResponse),
    Course(CourseResponse),
}
Expand description

Asset

Variants§

§

Jig(JigResponse)

JIG ID associated with the module.

§

Playlist(PlaylistResponse)

Playlist ID associated with the module.

§

Resource(ResourceResponse)

Resource ID associated with the module.

§

Course(CourseResponse)

Course ID associated with the module.

Implementations§

Source§

impl Asset

Source

pub fn asset_type(&self) -> AssetType

get asset type

Source

pub fn unwrap_jig(&self) -> &JigResponse

get jig value as ref

Source

pub fn unwrap_resource(&self) -> &ResourceResponse

get resource value as ref

Source

pub fn unwrap_playlist(&self) -> &PlaylistResponse

get playlist value as ref

Source

pub fn unwrap_course(&self) -> &CourseResponse

get course value as ref

Source

pub fn is_jig(&self) -> bool

check if is jig

Source

pub fn is_playlist(&self) -> bool

check if is playlist

Source

pub fn is_resource(&self) -> bool

check if is resource

Source

pub fn is_course(&self) -> bool

check if is course

Source

pub fn id(&self) -> AssetId

get id

Source

pub fn published_at(&self) -> Option<DateTime<Utc>>

get id

Source

pub fn display_name(&self) -> &String

get display_name

Source

pub fn language(&self) -> &String

get language

Source

pub fn description(&self) -> &String

get description

Source

pub fn cover(&self) -> Option<&LiteModule>

get cover

Source

pub fn privacy_level(&self) -> &PrivacyLevel

get privacy_level

Source

pub fn other_keywords(&self) -> &String

get other_keywords

Source

pub fn translated_keywords(&self) -> &String

get translated_keywords

Source

pub fn age_ranges(&self) -> &Vec<AgeRangeId>

get age_ranges

Source

pub fn affiliations(&self) -> &Vec<AffiliationId>

get affiliations

Source

pub fn categories(&self) -> &Vec<CategoryId>

get categories

Source

pub fn likes(&self) -> i64

get likes

Source

pub fn is_liked(&self) -> bool

is likes by current user

Source

pub fn plays(&self) -> i64

get plays

Source

pub fn author_id(&self) -> &Option<UserId>

get author_id

Source

pub fn author_name(&self) -> &Option<String>

get author_name

Source

pub fn additional_resources(&self) -> &Vec<AdditionalResource>

get additional_resources

Source

pub fn translated_description(&self) -> &HashMap<String, String>

get translated_description

Source

pub fn theme(&self) -> ThemeId

get theme

Source

pub fn live_up_to_date(&self) -> bool

get live_up_to_date

Source

pub fn premium(&self) -> bool

whether the current asset is a premium asset

Trait Implementations§

Source§

impl Clone for Asset

Source§

fn clone(&self) -> Asset

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Asset

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Asset

Source§

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 From<CourseResponse> for Asset

Source§

fn from(course: CourseResponse) -> Self

Converts to this type from the input type.
Source§

impl From<JigResponse> for Asset

Source§

fn from(jig: JigResponse) -> Self

Converts to this type from the input type.
Source§

impl From<PlaylistResponse> for Asset

Source§

fn from(playlist: PlaylistResponse) -> Self

Converts to this type from the input type.
Source§

impl From<ResourceResponse> for Asset

Source§

fn from(resource: ResourceResponse) -> Self

Converts to this type from the input type.
Source§

impl Serialize for Asset

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Asset

§

impl RefUnwindSafe for Asset

§

impl Send for Asset

§

impl Sync for Asset

§

impl Unpin for Asset

§

impl UnwindSafe for Asset

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T