pub struct VideoThumbnail {
pub url: String,
pub width: u32,
pub height: u32,
}
Expand description
§VideoThumbnail
Represents a single thumbnail image for a YouTube video.
YouTube provides thumbnails in multiple resolutions, and this struct stores information about one such thumbnail, including its URL and dimensions.
§Fields
url
- Direct URL to the thumbnail imagewidth
- Width of the thumbnail in pixelsheight
- Height of the thumbnail in pixels
§Common Resolutions
YouTube typically provides thumbnails in these standard resolutions:
- Default: 120×90
- Medium: 320×180
- High: 480×360
- Standard: 640×480
- Maxres: 1280×720
§Example Usage
let thumbnail = VideoThumbnail {
url: "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg".to_string(),
width: 480,
height: 360,
};
println!("Thumbnail ({}×{}): {}", thumbnail.width, thumbnail.height, thumbnail.url);
Fields§
§url: String
Direct URL to the thumbnail image
width: u32
Width of the thumbnail in pixels
height: u32
Height of the thumbnail in pixels
Trait Implementations§
Source§impl Clone for VideoThumbnail
impl Clone for VideoThumbnail
Source§fn clone(&self) -> VideoThumbnail
fn clone(&self) -> VideoThumbnail
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for VideoThumbnail
impl Debug for VideoThumbnail
Source§impl<'de> Deserialize<'de> for VideoThumbnail
impl<'de> Deserialize<'de> for VideoThumbnail
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
Auto Trait Implementations§
impl Freeze for VideoThumbnail
impl RefUnwindSafe for VideoThumbnail
impl Send for VideoThumbnail
impl Sync for VideoThumbnail
impl Unpin for VideoThumbnail
impl UnwindSafe for VideoThumbnail
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