[][src]Struct appstream::builders::VideoBuilder

pub struct VideoBuilder {
    pub width: Option<u32>,
    pub height: Option<u32>,
    pub codec: Option<String>,
    pub container: Option<String>,
    pub url: Url,
}

A helper to build a Video.

Example

use url::Url;
use appstream::builders::VideoBuilder;

let video = VideoBuilder::new(Url::parse("https://example.com/foobar/screencast.mkv").unwrap())
            .width(1600)
            .height(900)
            .codec("av1")
            .build();

Fields

width: Option<u32>

The video width.

height: Option<u32>

The video height.

codec: Option<String>

The necesssary codec to play the video.

container: Option<String>

The video container. Possible values are Matroska(.mkv) or WebM.

url: Url

The video URL.

Implementations

impl VideoBuilder[src]

pub fn new(url: Url) -> Self[src]

Creates a new VideoBuilder

Arguments

  • url - The video URL.

pub fn width(self, width: u32) -> Self[src]

Set the video width.

pub fn height(self, height: u32) -> Self[src]

Set the video height.

pub fn container(self, container: &str) -> Self[src]

The video container, either mkv or webm.

pub fn codec(self, codec: &str) -> Self[src]

The video codec, either vp9 or av1.

pub fn build(self) -> Video[src]

Construct a Video.

Trait Implementations

impl Debug for VideoBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.