Skip to main content

Clip

Struct Clip 

Source
pub struct Clip {
Show 37 fields pub id: String, pub title: String, pub audio_url: String, pub image_url: String, pub image_large_url: String, pub video_url: String, pub video_cover_url: String, pub tags: String, pub duration: f64, pub play_count: u64, pub status: String, pub created_at: String, pub display_name: String, pub handle: String, pub is_liked: bool, pub is_trashed: bool, pub has_vocal: bool, pub clip_type: String, pub prompt: String, pub gpt_description_prompt: String, pub lyrics: String, pub model_name: String, pub major_model_version: String, pub album_title: String, pub root_ancestor_id: String, pub lineage_status: String, pub edited_clip_id: String, pub task: String, pub is_remix: bool, pub cover_clip_id: String, pub upsample_clip_id: String, pub remaster_clip_id: String, pub speed_clip_id: String, pub override_history_clip_id: String, pub override_future_clip_id: String, pub history: Vec<HistoryEntry>, pub concat_history: Vec<HistoryEntry>,
}
Expand description

One finished Suno track, flattened from the API’s nested response shape.

Fields§

§id: String§title: String§audio_url: String§image_url: String§image_large_url: String§video_url: String§video_cover_url: String§tags: String§duration: f64§play_count: u64§status: String§created_at: String§display_name: String§handle: String§is_liked: bool§is_trashed: bool§has_vocal: bool§clip_type: String§prompt: String§gpt_description_prompt: String§lyrics: String§model_name: String§major_model_version: String§album_title: String§root_ancestor_id: String§lineage_status: String§edited_clip_id: String§task: String§is_remix: bool§cover_clip_id: String§upsample_clip_id: String§remaster_clip_id: String§speed_clip_id: String§override_history_clip_id: String§override_future_clip_id: String§history: Vec<HistoryEntry>§concat_history: Vec<HistoryEntry>

Implementations§

Source§

impl Clip

Source

pub fn from_json(raw: &Value) -> Clip

Build a Clip from one raw API clip object.

Clip-level fields and lineage live at the top level; content fields like tags and duration live under metadata. Temporary audiopipe audio URLs expire, so they are rewritten to the permanent CDN URL.

Source

pub fn mp3_url(&self) -> String

The MP3 source URL: the clip’s audio_url, or the deterministic CDN URL when it is empty.

Source

pub fn cover_candidates(&self) -> Vec<&str>

Cover-art URLs in preference order (large image, image, video cover), dropping any that are empty.

Source

pub fn selected_image_url(&self) -> Option<&str>

The preferred cover-art URL, or None when the clip carries no art.

Trait Implementations§

Source§

impl Clone for Clip

Source§

fn clone(&self) -> Clip

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Clip

Source§

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

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

impl Default for Clip

Source§

fn default() -> Clip

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Clip

Source§

fn eq(&self, other: &Clip) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Clip

Auto Trait Implementations§

§

impl Freeze for Clip

§

impl RefUnwindSafe for Clip

§

impl Send for Clip

§

impl Sync for Clip

§

impl Unpin for Clip

§

impl UnsafeUnpin for Clip

§

impl UnwindSafe for Clip

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.