Skip to main content

Clip

Struct Clip 

Source
pub struct Clip {
Show 45 fields pub id: String, pub title: String, pub audio_url: String, pub media_urls: Vec<MediaUrl>, 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 user_id: String, pub batch_index: Option<i64>, pub avatar_image_url: String, pub is_liked: bool, pub is_trashed: bool, pub has_vocal: bool, pub has_stem: bool, pub stem_from_id: String, pub stem_task: String, pub stem_type_id: Option<i64>, pub stem_type_group_name: String, 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 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>, pub clip_roots: Vec<ClipRoot>, pub clip_attribution_type: String,
}
Expand description

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

Fields§

§id: String§title: String§audio_url: String§media_urls: Vec<MediaUrl>

Every audio asset Suno lists for the clip (an mp3 plus, usually, an m4a-opus); empty when the API omits media_urls. The mp3 entry is the authoritative, non-expiring source.

§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§user_id: String

The clip owner’s account id (top-level user_id). Feeds the foreign-owner attribution check and cross-account dedup; empty when the API omits it.

§batch_index: Option<i64>

Index within a generation batch (paired gens), for sibling disambiguation in naming and dedup. None when batch_index is absent.

§avatar_image_url: String

The clip owner’s avatar image URL (avatar_image_url, or the user_-prefixed form on a parent-shaped clip). Empty when absent.

§is_liked: bool§is_trashed: bool§has_vocal: bool§has_stem: bool

Whether Suno reports this clip already has separated stems, from metadata.has_stem. The stems mirror uses it as a precondition: a clip whose has_stem is false or absent is never queried for stems.

§stem_from_id: String

metadata.stem_from_id: the clip this one was separated from, when it is a stem child. Empty when absent. Structured stem lineage, carried on an ordinary feed clip independently of the /stems listing.

§stem_task: String

metadata.stem_task: the separation-run id grouping one set of stems. Empty when absent.

§stem_type_id: Option<i64>

metadata.stem_type_id: the numeric separation-type id. Tolerates both the integer and the float (91.0) forms Suno has used; None when absent or non-numeric.

§stem_type_group_name: String

metadata.stem_type_group_name: the canonical stem group in underscore form (e.g. Backing_Vocals). Empty when absent. Preferred, normalised, over a title parenthetical as the stem label.

§clip_type: String§prompt: String§gpt_description_prompt: String§lyrics: String§model_name: String§major_model_version: 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>§clip_roots: Vec<ClipRoot>

The remix/attribution origins Suno lists under the nested clip_roots object (clip_roots.clips[]). Empty when the key is absent. These feed attribution edges and a same-owner gap-fill seed only; they are never read by structural root resolution.

§clip_attribution_type: String

The attribution kind for clip_roots (clip_roots.clip_attribution_type, e.g. "remix"). Open string, empty when absent.

Implementations§

Source§

impl Clip

Source

pub fn mp3_url(&self) -> String

The MP3 source URL, in priority order: the API-listed media_urls mp3 asset (authoritative and non-expiring), then the clip’s audio_url, then the deterministic CDN URL synthesised from the id.

Source

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

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

The video_cover_url preview is deliberately excluded: it is an MP4, not an embeddable still, so a clip with only a video preview yields no cover (the animated cover is embedded separately as a transcoded WebP).

Source

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

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

Like cover_candidates, the video_cover_url preview (an MP4) is deliberately excluded: this drives the static .jpg sidecars, the album folder.jpg, and the embedded-cover identity hash, none of which can use a video. A clip with only a video preview yields None.

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.

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.